Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ if st.button("Generate Themes"):
|
|
| 19 |
input_ids = tokenizer.encode(prompt, return_tensors="pt", truncation=True, max_length=1024)
|
| 20 |
|
| 21 |
# Generate themes using GPT-2
|
| 22 |
-
output = model.generate(input_ids, max_length=
|
| 23 |
|
| 24 |
# Decode the generated themes
|
| 25 |
generated_themes = tokenizer.decode(output[0], skip_special_tokens=True)
|
|
|
|
| 19 |
input_ids = tokenizer.encode(prompt, return_tensors="pt", truncation=True, max_length=1024)
|
| 20 |
|
| 21 |
# Generate themes using GPT-2
|
| 22 |
+
output = model.generate(input_ids, max_length=1024, num_beams=5, no_repeat_ngram_size=2, top_k=50, top_p=0.95, temperature=0.7)
|
| 23 |
|
| 24 |
# Decode the generated themes
|
| 25 |
generated_themes = tokenizer.decode(output[0], skip_special_tokens=True)
|