Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,8 +27,8 @@ class ChatBot:
|
|
| 27 |
|
| 28 |
self.model = Together(
|
| 29 |
model="meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
| 30 |
-
temperature=0.
|
| 31 |
-
max_tokens=
|
| 32 |
top_k=30,
|
| 33 |
together_api_key=TOGETHER_API_KEY
|
| 34 |
)
|
|
@@ -84,7 +84,7 @@ Javob:"""
|
|
| 84 |
|
| 85 |
def chat(self, message: str, history: List[Tuple[str, str]]) -> str:
|
| 86 |
try:
|
| 87 |
-
|
| 88 |
if message == "__init__":
|
| 89 |
return "Assalomu alaykum. Sizga qanday yordam bera olaman?"
|
| 90 |
|
|
@@ -111,7 +111,7 @@ def create_demo() -> gr.Interface:
|
|
| 111 |
gr.Markdown("""# RAG Chatbot
|
| 112 |
Beeline Uzbekistanning jismoniy shaxslar uchun tariflari haqida ma'lumotlar beruvchi bot""")
|
| 113 |
|
| 114 |
-
|
| 115 |
chatbot_interface = gr.Chatbot(
|
| 116 |
height=600,
|
| 117 |
show_copy_button=True,
|
|
@@ -137,7 +137,7 @@ def create_demo() -> gr.Interface:
|
|
| 137 |
return "", chat_history
|
| 138 |
|
| 139 |
def init_chat():
|
| 140 |
-
|
| 141 |
initial_greeting = chatbot.chat("__init__", [])
|
| 142 |
return [("", initial_greeting)]
|
| 143 |
|
|
@@ -145,7 +145,7 @@ def create_demo() -> gr.Interface:
|
|
| 145 |
msg.submit(respond, [msg, chatbot_interface], [msg, chatbot_interface])
|
| 146 |
clear.click(init_chat, None, chatbot_interface)
|
| 147 |
|
| 148 |
-
|
| 149 |
demo.load(init_chat, None, chatbot_interface)
|
| 150 |
|
| 151 |
return demo
|
|
|
|
| 27 |
|
| 28 |
self.model = Together(
|
| 29 |
model="meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
| 30 |
+
temperature=0.4,
|
| 31 |
+
max_tokens=256,
|
| 32 |
top_k=30,
|
| 33 |
together_api_key=TOGETHER_API_KEY
|
| 34 |
)
|
|
|
|
| 84 |
|
| 85 |
def chat(self, message: str, history: List[Tuple[str, str]]) -> str:
|
| 86 |
try:
|
| 87 |
+
|
| 88 |
if message == "__init__":
|
| 89 |
return "Assalomu alaykum. Sizga qanday yordam bera olaman?"
|
| 90 |
|
|
|
|
| 111 |
gr.Markdown("""# RAG Chatbot
|
| 112 |
Beeline Uzbekistanning jismoniy shaxslar uchun tariflari haqida ma'lumotlar beruvchi bot""")
|
| 113 |
|
| 114 |
+
|
| 115 |
chatbot_interface = gr.Chatbot(
|
| 116 |
height=600,
|
| 117 |
show_copy_button=True,
|
|
|
|
| 137 |
return "", chat_history
|
| 138 |
|
| 139 |
def init_chat():
|
| 140 |
+
|
| 141 |
initial_greeting = chatbot.chat("__init__", [])
|
| 142 |
return [("", initial_greeting)]
|
| 143 |
|
|
|
|
| 145 |
msg.submit(respond, [msg, chatbot_interface], [msg, chatbot_interface])
|
| 146 |
clear.click(init_chat, None, chatbot_interface)
|
| 147 |
|
| 148 |
+
|
| 149 |
demo.load(init_chat, None, chatbot_interface)
|
| 150 |
|
| 151 |
return demo
|