Spaces:
Sleeping
Sleeping
Commit
·
f2f28df
1
Parent(s):
69e65d2
Added a toggle to hide Gemini in the UI:
Browse files- app.py: reads ENABLE_GEMINI (default true). If set to false/0/no, the Gemini option is removed from the model dropdown.
- README.md: documented the ENABLE_GEMINI env var.
README.md
CHANGED
|
@@ -35,6 +35,7 @@ Use `PORT`/`HOST` env vars if you need custom binding (Gradio honors them).
|
|
| 35 |
- `schemas.py` provides structural validation and summary helper.
|
| 36 |
- `settings.py` loads config with env overrides.
|
| 37 |
- Prompt is read from `prompts/micro-trend-prompt.md` unchanged.
|
|
|
|
| 38 |
|
| 39 |
## Gemini auth notes
|
| 40 |
- Two modes:
|
|
|
|
| 35 |
- `schemas.py` provides structural validation and summary helper.
|
| 36 |
- `settings.py` loads config with env overrides.
|
| 37 |
- Prompt is read from `prompts/micro-trend-prompt.md` unchanged.
|
| 38 |
+
- Set `ENABLE_GEMINI=false` to hide Gemini from the model dropdown (useful on Spaces if Gemini isn’t available).
|
| 39 |
|
| 40 |
## Gemini auth notes
|
| 41 |
- Two modes:
|
app.py
CHANGED
|
@@ -68,6 +68,8 @@ def make_interface():
|
|
| 68 |
return [], "", ""
|
| 69 |
return files, gr.update(), gr.update()
|
| 70 |
|
|
|
|
|
|
|
| 71 |
with gr.Blocks(title="Garment Micro-Trend Detector") as demo:
|
| 72 |
gr.Markdown(
|
| 73 |
"Upload garment image(s), pick a model, and get structured micro-trend JSON plus a bullet summary."
|
|
@@ -76,7 +78,9 @@ def make_interface():
|
|
| 76 |
with gr.Row():
|
| 77 |
image_input = gr.Files(file_count="multiple", label="Garment images")
|
| 78 |
with gr.Column():
|
| 79 |
-
model_choices = [OPENAI_GPT5, OPENAI_GPT5_MINI
|
|
|
|
|
|
|
| 80 |
default_model = settings.openai_model if settings.openai_model in model_choices else OPENAI_GPT5_MINI
|
| 81 |
model_dd = gr.Dropdown(
|
| 82 |
choices=model_choices,
|
|
|
|
| 68 |
return [], "", ""
|
| 69 |
return files, gr.update(), gr.update()
|
| 70 |
|
| 71 |
+
enable_gemini = os.environ.get("ENABLE_GEMINI", "true").lower() not in {"0", "false", "no"}
|
| 72 |
+
|
| 73 |
with gr.Blocks(title="Garment Micro-Trend Detector") as demo:
|
| 74 |
gr.Markdown(
|
| 75 |
"Upload garment image(s), pick a model, and get structured micro-trend JSON plus a bullet summary."
|
|
|
|
| 78 |
with gr.Row():
|
| 79 |
image_input = gr.Files(file_count="multiple", label="Garment images")
|
| 80 |
with gr.Column():
|
| 81 |
+
model_choices = [OPENAI_GPT5, OPENAI_GPT5_MINI]
|
| 82 |
+
if enable_gemini:
|
| 83 |
+
model_choices.append(GEMINI_3_VISION)
|
| 84 |
default_model = settings.openai_model if settings.openai_model in model_choices else OPENAI_GPT5_MINI
|
| 85 |
model_dd = gr.Dropdown(
|
| 86 |
choices=model_choices,
|