Spaces:
Running on Zero
Running on Zero
Fix model display labels being passed as repository IDs
Browse files
README.md
CHANGED
|
@@ -149,6 +149,10 @@ The added model architectures were checked using reduced test configurations.
|
|
| 149 |
Gemma downloads about 2 GB and is slower on CPU; the Qwen models download about
|
| 150 |
1?1.5 GB. Base models are labelled separately from instruction-tuned models.
|
| 151 |
Custom public model repository IDs and main repository URLs remain supported.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
|
| 153 |
## Controls
|
| 154 |
|
|
|
|
| 149 |
Gemma downloads about 2 GB and is slower on CPU; the Qwen models download about
|
| 150 |
1?1.5 GB. Base models are labelled separately from instruction-tuned models.
|
| 151 |
Custom public model repository IDs and main repository URLs remain supported.
|
| 152 |
+
The dropdown sends canonical repository IDs; descriptions are shown separately.
|
| 153 |
+
Older display labels are also resolved on the backend for cached browser pages.
|
| 154 |
+
Prompt-free output is not restricted to prose: code and other learned document
|
| 155 |
+
formats may emerge, and temperature controls randomness rather than genre.
|
| 156 |
|
| 157 |
## Controls
|
| 158 |
|
app.py
CHANGED
|
@@ -193,15 +193,19 @@ def build_app():
|
|
| 193 |
with gr.Column(elem_id="model-picker") as picker:
|
| 194 |
gr.HTML('<header><div class="eyebrow">AN EXPERIMENT IN AUTOMATIC WRITING</div>'
|
| 195 |
'<h1>Let it flow<span>.</span></h1><p>Choose a model. Enter its token space.</p></header>')
|
| 196 |
-
repo = gr.Dropdown(
|
| 197 |
label="Public model repository or Hugging Face URL")
|
|
|
|
|
|
|
|
|
|
| 198 |
load = gr.Button("Load model & enter space", variant="primary")
|
| 199 |
gr.Markdown("Small **base models** work best. Public safetensors models only; "
|
| 200 |
"2 GB download limit. One model is shared by visitors. "
|
| 201 |
"Loading includes preparing a fixed 3D embedding projection.")
|
| 202 |
gr.Markdown("Gemma 3 1B downloads about 2 GB and is slower on CPU. Qwen3 0.6B downloads "
|
| 203 |
"about 1.2–1.5 GB. Base models are the closest fit for prompt-free continuation. "
|
| 204 |
-
"Gemma presets use safetensors versions; GGUF files are not supported by this backend."
|
|
|
|
| 205 |
with gr.Column(visible=False, elem_id="flow-workspace") as workspace:
|
| 206 |
gr.HTML(SCENE, elem_id="space-scene")
|
| 207 |
page = gr.Textbox(label="The stream", lines=5, max_lines=8,
|
|
|
|
| 193 |
with gr.Column(elem_id="model-picker") as picker:
|
| 194 |
gr.HTML('<header><div class="eyebrow">AN EXPERIMENT IN AUTOMATIC WRITING</div>'
|
| 195 |
'<h1>Let it flow<span>.</span></h1><p>Choose a model. Enter its token space.</p></header>')
|
| 196 |
+
repo = gr.Dropdown(PRESETS, value=PRESETS[0], allow_custom_value=True,
|
| 197 |
label="Public model repository or Hugging Face URL")
|
| 198 |
+
model_note = gr.Textbox(value=MODEL_LABELS[PRESETS[0]], label="Model description", interactive=False)
|
| 199 |
+
repo.change(lambda value: MODEL_LABELS.get(value, "Custom public model repository or URL"),
|
| 200 |
+
[repo], model_note, queue=False, api_name="model_description")
|
| 201 |
load = gr.Button("Load model & enter space", variant="primary")
|
| 202 |
gr.Markdown("Small **base models** work best. Public safetensors models only; "
|
| 203 |
"2 GB download limit. One model is shared by visitors. "
|
| 204 |
"Loading includes preparing a fixed 3D embedding projection.")
|
| 205 |
gr.Markdown("Gemma 3 1B downloads about 2 GB and is slower on CPU. Qwen3 0.6B downloads "
|
| 206 |
"about 1.2–1.5 GB. Base models are the closest fit for prompt-free continuation. "
|
| 207 |
+
"Gemma presets use safetensors versions; GGUF files are not supported by this backend. "
|
| 208 |
+
"Without a written prompt, output can be prose, code, lists, or other training-data patterns.")
|
| 209 |
with gr.Column(visible=False, elem_id="flow-workspace") as workspace:
|
| 210 |
gr.HTML(SCENE, elem_id="space-scene")
|
| 211 |
page = gr.Textbox(label="The stream", lines=5, max_lines=8,
|
models.py
CHANGED
|
@@ -26,6 +26,8 @@ PRESETS = list(MODEL_LABELS)
|
|
| 26 |
|
| 27 |
def repository(value):
|
| 28 |
value = value.strip()
|
|
|
|
|
|
|
| 29 |
if "://" in value:
|
| 30 |
url = urlsplit(value)
|
| 31 |
if url.scheme != "https" or url.netloc != "huggingface.co":
|
|
|
|
| 26 |
|
| 27 |
def repository(value):
|
| 28 |
value = value.strip()
|
| 29 |
+
# Accept labels from older/cached dropdown UIs as well as canonical IDs.
|
| 30 |
+
value = {label: repo for repo, label in MODEL_LABELS.items()}.get(value, value)
|
| 31 |
if "://" in value:
|
| 32 |
url = urlsplit(value)
|
| 33 |
if url.scheme != "https" or url.netloc != "huggingface.co":
|