un-index commited on
Commit
4d0bba1
·
1 Parent(s): 3a988df
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -138,8 +138,8 @@ def f(context, temperature, top_p, max_length, model_idx, SPACE_VERIFICATION_KEY
138
  # NOTE sometimes it seems to contain another array, weird
139
  try:
140
  # todo fix max_length below, maybe there is a max_new_tokens parameter
141
- # try =len(context)+max_length or =len(context)+max_length or make max_length inf or unspecified
142
- generated_text = generator(context, max_new_tokens=max_length, top_p=top_p, temperature=temperature, num_return_sequences=1)
143
  except Exception as e:
144
  return "Exception while generating text: " + str(e)
145
  # [0][0]['generated_text']
 
138
  # NOTE sometimes it seems to contain another array, weird
139
  try:
140
  # todo fix max_length below, maybe there is a max_new_tokens parameter
141
+ # try max_length=len(context)+max_length or =len(context)+max_length or make max_length inf or unspecified
142
+ generated_text = generator(context, max_length=400, max_new_tokens=max_length, top_p=top_p, temperature=temperature, num_return_sequences=1)
143
  except Exception as e:
144
  return "Exception while generating text: " + str(e)
145
  # [0][0]['generated_text']