-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathchatbot.py
More file actions
19 lines (17 loc) · 885 Bytes
/
chatbot.py
File metadata and controls
19 lines (17 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-
from sinapsis.webapp.chatbot_base import BaseChatbot, ChatbotConfig
from sinapsis_core.utils.env_var_keys import AGENT_CONFIG_PATH, GRADIO_SHARE_APP, SINAPSIS_CACHE_DIR
CONFIG_FILE = AGENT_CONFIG_PATH or "webapps/configs/llama_cpp/llama_cpp_chatbot.yaml"
DELETE_HISTORY_CONFIG = "webapps/configs/llama_cpp/delete_history.yaml"
if __name__ == "__main__":
config = ChatbotConfig(
app_title="Sinapsis Chatbot",
examples=[
"Explain quantum computing in simple terms",
"Write a short poem about artificial intelligence",
"How would I summarize a 10-page PDF about climate change?",
],
delete_history_config_path=DELETE_HISTORY_CONFIG,
)
sinapsis_chatbot = BaseChatbot(CONFIG_FILE, config=config)
sinapsis_chatbot.launch(share=GRADIO_SHARE_APP, allowed_paths=[SINAPSIS_CACHE_DIR])