phamson02
commited on
Commit
路
d0547af
1
Parent(s):
e4bec4f
update
Browse files- generate_poem.py +4 -0
generate_poem.py
CHANGED
@@ -7,6 +7,10 @@ model = T5ForConditionalGeneration.from_pretrained("Libosa2707/vietnamese-poem-t
|
|
7 |
|
8 |
|
9 |
def generate_poem(input_text):
|
|
|
|
|
|
|
|
|
10 |
# Define the parameters for the generate function
|
11 |
min_length = 50
|
12 |
max_length = 100
|
|
|
7 |
|
8 |
|
9 |
def generate_poem(input_text):
|
10 |
+
# Preprocess the input text
|
11 |
+
input_text = input_text.strip()
|
12 |
+
input_text = input_text.lower()
|
13 |
+
|
14 |
# Define the parameters for the generate function
|
15 |
min_length = 50
|
16 |
max_length = 100
|