Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,7 +58,8 @@ def respond(
|
|
| 58 |
messages.append({"role": "user", "content": message})
|
| 59 |
print("Latest user message appended.")
|
| 60 |
|
| 61 |
-
# Determine which model to use
|
|
|
|
| 62 |
model_to_use = custom_model.strip() if custom_model.strip() != "" else selected_model
|
| 63 |
print(f"Model selected for inference: {model_to_use}")
|
| 64 |
|
|
@@ -234,8 +235,8 @@ def filter_models(search_term):
|
|
| 234 |
|
| 235 |
def set_custom_model_from_radio(selected):
|
| 236 |
"""
|
| 237 |
-
This function
|
| 238 |
-
|
| 239 |
"""
|
| 240 |
print(f"Featured model selected: {selected}")
|
| 241 |
return selected
|
|
@@ -270,13 +271,13 @@ with demo:
|
|
| 270 |
)
|
| 271 |
print("Model search box change event linked.")
|
| 272 |
|
| 273 |
-
#
|
| 274 |
-
featured_model_radio.change(
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
)
|
| 279 |
-
print("Featured model radio button change event linked.")
|
| 280 |
|
| 281 |
print("Gradio interface initialized.")
|
| 282 |
|
|
|
|
| 58 |
messages.append({"role": "user", "content": message})
|
| 59 |
print("Latest user message appended.")
|
| 60 |
|
| 61 |
+
# Determine which model to use
|
| 62 |
+
# If custom_model is provided, use it; otherwise use the selected model from radio
|
| 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 |
+
This function is no longer used, but kept for reference.
|
| 239 |
+
Previously it would update the Custom Model textbox with the selected model.
|
| 240 |
"""
|
| 241 |
print(f"Featured model selected: {selected}")
|
| 242 |
return selected
|
|
|
|
| 271 |
)
|
| 272 |
print("Model search box change event linked.")
|
| 273 |
|
| 274 |
+
# Remove this connection so the custom model box doesn't get filled automatically
|
| 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 |
|