Spaces:
Runtime error
Runtime error
Update app.py
Browse filesLower the temperature
app.py
CHANGED
@@ -187,7 +187,9 @@ def generate(starting_text):
|
|
187 |
# If the temperature is high, the model has a greater chance of outputting different words than those with the highest probability.
|
188 |
# The generated text will feature a greater variety of topics, but there is also an increased likelihood that it will generate nonsense text and
|
189 |
# contain grammatical errors.
|
190 |
-
|
|
|
|
|
191 |
response=""
|
192 |
#response = gpt2_tensors
|
193 |
for i, x in enumerate(gpt2_tensors):
|
|
|
187 |
# If the temperature is high, the model has a greater chance of outputting different words than those with the highest probability.
|
188 |
# The generated text will feature a greater variety of topics, but there is also an increased likelihood that it will generate nonsense text and
|
189 |
# contain grammatical errors.
|
190 |
+
|
191 |
+
# With less temperature (1.5 --> 0.1), the output becomes less variational.
|
192 |
+
gpt2_tensors = mdl.generate(tkn_ids, max_length=100, no_repeat_ngram_size=True, num_beams=3, do_sample=True, temperature=0.1)
|
193 |
response=""
|
194 |
#response = gpt2_tensors
|
195 |
for i, x in enumerate(gpt2_tensors):
|