Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -59,7 +59,7 @@ def respond(
|
|
59 |
print("Latest user message appended.")
|
60 |
|
61 |
# Determine which model to use
|
62 |
-
#
|
63 |
model_to_use = custom_model.strip() if custom_model.strip() != "" else selected_model
|
64 |
print(f"Model selected for inference: {model_to_use}")
|
65 |
|
@@ -235,11 +235,11 @@ def filter_models(search_term):
|
|
235 |
|
236 |
def set_custom_model_from_radio(selected):
|
237 |
"""
|
238 |
-
|
239 |
-
|
240 |
"""
|
241 |
print(f"Featured model selected: {selected}")
|
242 |
-
return selected
|
243 |
|
244 |
# Create the Gradio interface
|
245 |
demo = gr.ChatInterface(
|
@@ -271,13 +271,13 @@ with demo:
|
|
271 |
)
|
272 |
print("Model search box change event linked.")
|
273 |
|
274 |
-
#
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
|
282 |
print("Gradio interface initialized.")
|
283 |
|
|
|
59 |
print("Latest user message appended.")
|
60 |
|
61 |
# Determine which model to use
|
62 |
+
# Only use custom_model if it's not empty and was manually entered by user
|
63 |
model_to_use = custom_model.strip() if custom_model.strip() != "" else selected_model
|
64 |
print(f"Model selected for inference: {model_to_use}")
|
65 |
|
|
|
235 |
|
236 |
def set_custom_model_from_radio(selected):
|
237 |
"""
|
238 |
+
Function is disabled - now just returns empty string to prevent auto-filling
|
239 |
+
Custom Model field when selecting from the radio buttons
|
240 |
"""
|
241 |
print(f"Featured model selected: {selected}")
|
242 |
+
return "" # Return empty string instead of the selected model
|
243 |
|
244 |
# Create the Gradio interface
|
245 |
demo = gr.ChatInterface(
|
|
|
271 |
)
|
272 |
print("Model search box change event linked.")
|
273 |
|
274 |
+
# Connect the featured model radio to update the custom model box
|
275 |
+
featured_model_radio.change(
|
276 |
+
fn=set_custom_model_from_radio,
|
277 |
+
inputs=featured_model_radio,
|
278 |
+
outputs=custom_model_box
|
279 |
+
)
|
280 |
+
print("Featured model radio button change event linked.")
|
281 |
|
282 |
print("Gradio interface initialized.")
|
283 |
|