lvwerra HF staff commited on
Commit
1ea7ac9
1 Parent(s): 220e795

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -93,11 +93,11 @@ def generate(prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition
93
  output = prompt
94
 
95
  for response in stream:
96
- output += response.token.text
 
 
 
97
  yield output
98
-
99
- if fim_mode:
100
- output += suffix
101
  return output
102
 
103
 
 
93
  output = prompt
94
 
95
  for response in stream:
96
+ if fim_mode and response.token.text =="<|endoftext|>":
97
+ output += (suffix + response.token.text)
98
+ else:
99
+ output += response.token.text
100
  yield output
 
 
 
101
  return output
102
 
103