un-index commited on
Commit
1bb82d6
·
1 Parent(s): 4263afd
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -146,7 +146,7 @@ def f(context, temperature, top_p, max_length, model_idx, SPACE_VERIFICATION_KEY
146
  # try max_length=len(context)+max_length or =len(context)+max_length or make max_length inf or unspecified
147
  # note: added max_new_tokens parameter to see whether it actually works, if not remove,
148
  # TODO if yes, then make max_length infinite because it seems to be counted as max input length, not output
149
- generated_text = generator(context, max_length=2**12, max_new_tokens=max_length, top_p=top_p, temperature=temperature, num_return_sequences=1)
150
  except Exception as e:
151
  return "Exception while generating text: " + str(e)
152
  # [0][0]['generated_text']
 
146
  # try max_length=len(context)+max_length or =len(context)+max_length or make max_length inf or unspecified
147
  # note: added max_new_tokens parameter to see whether it actually works, if not remove,
148
  # TODO if yes, then make max_length infinite because it seems to be counted as max input length, not output
149
+ generated_text = generator(context, max_length=896, max_new_tokens=max_length, top_p=top_p, temperature=temperature, num_return_sequences=1)
150
  except Exception as e:
151
  return "Exception while generating text: " + str(e)
152
  # [0][0]['generated_text']