aadya1762 commited on
Commit
0adab94
·
1 Parent(s): 1719ee5
Files changed (1) hide show
  1. gemmademo/_chat.py +2 -1
gemmademo/_chat.py CHANGED
@@ -26,7 +26,7 @@ class GradioChat:
26
  return LlamaCppGemmaModel(name=model_name).load_model()
27
 
28
  def _chat(self):
29
- def chat_fn(history, message, selected_model):
30
  if selected_model != self.current_model_name:
31
  self.current_model_name = selected_model
32
  self.model = self._load_model(selected_model) # Reload model when changed
@@ -39,6 +39,7 @@ class GradioChat:
39
  chat_fn,
40
  textbox=gr.Textbox(placeholder="What is up?", container=False),
41
  additional_inputs=[
 
42
  gr.Dropdown(choices=self.model_options, value=self.current_model_name, label="Select Gemma Model"),
43
  gr.Dropdown(choices=self.task_options, value="Question Answering", label="Select Task"),
44
  ],
 
26
  return LlamaCppGemmaModel(name=model_name).load_model()
27
 
28
  def _chat(self):
29
+ def chat_fn(message, history, selected_model):
30
  if selected_model != self.current_model_name:
31
  self.current_model_name = selected_model
32
  self.model = self._load_model(selected_model) # Reload model when changed
 
39
  chat_fn,
40
  textbox=gr.Textbox(placeholder="What is up?", container=False),
41
  additional_inputs=[
42
+ gr.State(self.current_model_name), # Store selected model state
43
  gr.Dropdown(choices=self.model_options, value=self.current_model_name, label="Select Gemma Model"),
44
  gr.Dropdown(choices=self.task_options, value="Question Answering", label="Select Task"),
45
  ],