ysharma HF staff commited on
Commit
e9ae9e4
1 Parent(s): c57a974

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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