OrifjonKenjayev commited on
Commit
bd77084
·
verified ·
1 Parent(s): 409e026

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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.1,
31
- max_tokens=128,
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
- # Skip processing for the initial greeting
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
- # Initialize the chatbot interface without the greeting
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
- # Initialize with greeting
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
- # Set initial greeting when the interface loads
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