phamson02
commited on
Commit
•
cd29b18
1
Parent(s):
0eb9251
update
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def generate_poem(text, style):
|
|
28 |
model = models[style]
|
29 |
|
30 |
# Tokenize the input line
|
31 |
-
input_ids = tokenizer.encode(text, return_tensors="pt")
|
32 |
|
33 |
# Generate text
|
34 |
output = model.generate(input_ids, max_length=100, do_sample=True, temperature=0.7)
|
|
|
28 |
model = models[style]
|
29 |
|
30 |
# Tokenize the input line
|
31 |
+
input_ids = tokenizer.encode(text, return_tensors="pt")[:, :-1]
|
32 |
|
33 |
# Generate text
|
34 |
output = model.generate(input_ids, max_length=100, do_sample=True, temperature=0.7)
|