Workaround for example caching
Browse files
app.py
CHANGED
@@ -149,14 +149,20 @@ demo = gr.Interface(
|
|
149 |
f'Model: `{repo_id}`.'
|
150 |
,
|
151 |
examples=[
|
152 |
-
|
|
|
|
|
153 |
# This would be a good example, but Qwen2-0.5B occasionally goes off-color.
|
154 |
#[48, 8, 'Tell me a joke.', 'Tell me a funny joke.'],
|
155 |
-
|
156 |
-
|
|
|
|
|
157 |
],
|
158 |
# In HuggingFace Spaces, this defaults to true, which makes startup
|
159 |
# take a very long time.
|
|
|
|
|
160 |
cache_examples=False,
|
161 |
)
|
162 |
|
|
|
149 |
f'Model: `{repo_id}`.'
|
150 |
,
|
151 |
examples=[
|
152 |
+
# To mitigate the slow caching, produce only 1 response.
|
153 |
+
[48, 1, 'Count from 1 to 5.', 'Count from 1 to 6.'],
|
154 |
+
|
155 |
# This would be a good example, but Qwen2-0.5B occasionally goes off-color.
|
156 |
#[48, 8, 'Tell me a joke.', 'Tell me a funny joke.'],
|
157 |
+
|
158 |
+
# To avoid the slow caching, omit these.
|
159 |
+
#[48, 8, 'Calculate 3 + 4', 'Calculate 3 + 5'],
|
160 |
+
#[48, 8, "What's the capital of Canada?", "What's the capital of France?"],
|
161 |
],
|
162 |
# In HuggingFace Spaces, this defaults to true, which makes startup
|
163 |
# take a very long time.
|
164 |
+
# This however currently seems to be bugged,
|
165 |
+
# in that Spaces will cache the examples regardless.
|
166 |
cache_examples=False,
|
167 |
)
|
168 |
|