Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,8 @@ def text2text(input_text):
|
|
40 |
print("Length of input: " + str(len(input_text)))
|
41 |
|
42 |
# Does not seem to care if it goes over 512... humm...
|
43 |
-
|
|
|
44 |
|
45 |
# Remove <pad> and </s> eof sequence tokens
|
46 |
model_output_text = tokenizer.decode(outputs[0],skip_special_tokens=True)
|
|
|
40 |
print("Length of input: " + str(len(input_text)))
|
41 |
|
42 |
# Does not seem to care if it goes over 512... humm...
|
43 |
+
# To make it faster generate 100 tokens at a time
|
44 |
+
outputs = model.generate(input_ids, max_new_tokens=100, do_sample=True, temperature=0.7, top_p=0.8)
|
45 |
|
46 |
# Remove <pad> and </s> eof sequence tokens
|
47 |
model_output_text = tokenizer.decode(outputs[0],skip_special_tokens=True)
|