OrifjonKenjayev commited on
Commit
e270156
·
verified ·
1 Parent(s): ce0b82c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -16,7 +16,7 @@ class ChatBot:
16
  def __init__(self):
17
  # Initialize embeddings
18
  self.embeddings = TogetherEmbeddings(
19
- model="togethercomputer/m2-bert-80M-8k-retrieval",
20
  together_api_key=TOGETHER_API_KEY
21
  )
22
 
@@ -31,9 +31,9 @@ class ChatBot:
31
  # Initialize the model
32
  self.model = Together(
33
  model="meta-llama/Llama-3.3-70B-Instruct-Turbo",
34
- temperature=0.2,
35
- max_tokens=100,
36
- top_k=20,
37
  together_api_key=TOGETHER_API_KEY
38
  )
39
 
@@ -112,8 +112,8 @@ def create_demo() -> gr.Interface:
112
  chatbot = ChatBot()
113
 
114
  with gr.Blocks() as demo:
115
- gr.Markdown("""# Knowledge Base Chatbot
116
- Ask questions about your documents and get informed responses!""")
117
 
118
  chatbot_interface = gr.Chatbot(
119
  height=600,
@@ -123,12 +123,12 @@ def create_demo() -> gr.Interface:
123
  with gr.Row():
124
  msg = gr.Textbox(
125
  show_label=False,
126
- placeholder="Type your message here...",
127
  container=False
128
  )
129
- submit = gr.Button("Send", variant="primary")
130
 
131
- clear = gr.Button("New Chat")
132
 
133
  def respond(message, chat_history):
134
  # Foydalanuvchi xabarini tozalash
 
16
  def __init__(self):
17
  # Initialize embeddings
18
  self.embeddings = TogetherEmbeddings(
19
+ model="togethercomputer/m2-bert-80M-32k-retrieval",
20
  together_api_key=TOGETHER_API_KEY
21
  )
22
 
 
31
  # Initialize the model
32
  self.model = Together(
33
  model="meta-llama/Llama-3.3-70B-Instruct-Turbo",
34
+ temperature=0.7,
35
+ max_tokens=256,
36
+ top_k=50,
37
  together_api_key=TOGETHER_API_KEY
38
  )
39
 
 
112
  chatbot = ChatBot()
113
 
114
  with gr.Blocks() as demo:
115
+ gr.Markdown("""# RAG Chatbot
116
+ Beeline Uzbekistanning jismoniy shaxslar uchun tariflari haqida ma'lumotlar beruvchi bot""")
117
 
118
  chatbot_interface = gr.Chatbot(
119
  height=600,
 
123
  with gr.Row():
124
  msg = gr.Textbox(
125
  show_label=False,
126
+ placeholder="Xabaringizni shu yerda yozing",
127
  container=False
128
  )
129
+ submit = gr.Button("Xabarni yuborish", variant="primary")
130
 
131
+ clear = gr.Button("Yangi suhbat")
132
 
133
  def respond(message, chat_history):
134
  # Foydalanuvchi xabarini tozalash