expandme commited on
Commit
1ad60df
1 Parent(s): 8884b58

Dynmaic desription FIX 1 ? - What wind.surf will do ?

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -43,7 +43,6 @@ def respond(
43
  message,
44
  history: list[tuple[str, str]],
45
  model_name,
46
- description_text,
47
  system_message,
48
  max_tokens,
49
  temperature,
@@ -79,7 +78,6 @@ def respond(
79
  message_repl = message_repl + \
80
  chunk['choices'][0]["delta"]["content"]
81
  yield message_repl
82
-
83
  """
84
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
85
  """
@@ -87,7 +85,7 @@ demo = gr.ChatInterface(
87
  respond,
88
  title="GGUF is popular format on PC in LM Studio or on Tablet/Mobile in PocketPal APPs",
89
  description="Try models locclay in: 🖥️ [LM Studio AI for PC](https://lmstudio.ai) | 📱 PocketPal AI ([Android](https://play.google.com/store/apps/details?id=com.pocketpalai) & [iOS](https://play.google.com/store/apps/details?id=com.pocketpalai)) on Tablet or Mobile",
90
-
91
  additional_inputs=[
92
  gr.Dropdown(
93
  choices=list(MODELS.keys()),
@@ -157,7 +155,8 @@ demo = gr.ChatInterface(
157
  if __name__ == "__main__":
158
  with gr.Blocks() as blocks:
159
  chatbot = demo.render()
 
160
  model_dropdown = [comp for comp in chatbot.children if isinstance(comp, gr.Dropdown)][0]
161
- description_box = [comp for comp in chatbot.children if isinstance(comp, gr.Textbox)][0]
162
- model_dropdown.change(fn=update_description, inputs=[model_dropdown], outputs=[description_box])
163
  blocks.launch()
 
43
  message,
44
  history: list[tuple[str, str]],
45
  model_name,
 
46
  system_message,
47
  max_tokens,
48
  temperature,
 
78
  message_repl = message_repl + \
79
  chunk['choices'][0]["delta"]["content"]
80
  yield message_repl
 
81
  """
82
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
83
  """
 
85
  respond,
86
  title="GGUF is popular format on PC in LM Studio or on Tablet/Mobile in PocketPal APPs",
87
  description="Try models locclay in: 🖥️ [LM Studio AI for PC](https://lmstudio.ai) | 📱 PocketPal AI ([Android](https://play.google.com/store/apps/details?id=com.pocketpalai) & [iOS](https://play.google.com/store/apps/details?id=com.pocketpalai)) on Tablet or Mobile",
88
+
89
  additional_inputs=[
90
  gr.Dropdown(
91
  choices=list(MODELS.keys()),
 
155
  if __name__ == "__main__":
156
  with gr.Blocks() as blocks:
157
  chatbot = demo.render()
158
+ # Get the model dropdown component
159
  model_dropdown = [comp for comp in chatbot.children if isinstance(comp, gr.Dropdown)][0]
160
+ # Add event handler for model change
161
+ model_dropdown.change(fn=lambda x: None, inputs=[model_dropdown], outputs=[])
162
  blocks.launch()