Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -63,7 +63,10 @@ def codegemma(message: str,
|
|
63 |
do_sample=True,
|
64 |
temperature=temperature,
|
65 |
)
|
66 |
-
|
|
|
|
|
|
|
67 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
68 |
t.start()
|
69 |
|
|
|
63 |
do_sample=True,
|
64 |
temperature=temperature,
|
65 |
)
|
66 |
+
# This will enforce greedy generation (do_sample=False) when the temperature is passed 0, avoiding the crash.
|
67 |
+
if temperature == 0:
|
68 |
+
generate_kwargs['do_sample'] = False
|
69 |
+
|
70 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
71 |
t.start()
|
72 |
|