Update app.py
Browse files
app.py
CHANGED
|
@@ -163,16 +163,12 @@ with gr.Blocks(theme=gr.themes.Soft(), title="AnyCoder - AI Code Generator") as
|
|
| 163 |
gr.Markdown("## π AnyCoder AI")
|
| 164 |
gr.Markdown("Your personal AI partner for generating, modifying, and understanding code.")
|
| 165 |
|
| 166 |
-
#
|
| 167 |
-
|
| 168 |
-
for model in AVAILABLE_MODELS
|
| 169 |
-
category = model.get("category", "Other")
|
| 170 |
-
if category not in model_choices:
|
| 171 |
-
model_choices[category] = []
|
| 172 |
-
model_choices[category].append(model["name"])
|
| 173 |
|
| 174 |
model_dd = gr.Dropdown(
|
| 175 |
-
choices=
|
| 176 |
value=initial_model["name"],
|
| 177 |
label="π€ Select AI Model",
|
| 178 |
info="Different models have different strengths. Experiment!"
|
|
|
|
| 163 |
gr.Markdown("## π AnyCoder AI")
|
| 164 |
gr.Markdown("Your personal AI partner for generating, modifying, and understanding code.")
|
| 165 |
|
| 166 |
+
# Create a flat list of model names for the dropdown.
|
| 167 |
+
# The grouped choices format was causing a ValueError with the current setup.
|
| 168 |
+
model_choices = [model["name"] for model in AVAILABLE_MODELS]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
|
| 170 |
model_dd = gr.Dropdown(
|
| 171 |
+
choices=model_choices,
|
| 172 |
value=initial_model["name"],
|
| 173 |
label="π€ Select AI Model",
|
| 174 |
info="Different models have different strengths. Experiment!"
|