Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def app():
|
|
24 |
generator = pipeline("text-generation", model)
|
25 |
|
26 |
# ηζζζ¬
|
27 |
-
output = generator(input_text, max_length=int(
|
28 |
|
29 |
# ζεηζηζζ¬
|
30 |
generated_text = output[0]["generated_text"].strip()
|
@@ -34,14 +34,14 @@ def app():
|
|
34 |
generated_text = ""
|
35 |
if button_generate:
|
36 |
current_len = 0
|
37 |
-
while current_len<maxlen:
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
|
46 |
if __name__ == "__main__":
|
47 |
# θΏθ‘εΊη¨η¨εΊ
|
|
|
24 |
generator = pipeline("text-generation", model)
|
25 |
|
26 |
# ηζζζ¬
|
27 |
+
output = generator(input_text, max_length=int(maxlen), num_return_sequences=1)
|
28 |
|
29 |
# ζεηζηζζ¬
|
30 |
generated_text = output[0]["generated_text"].strip()
|
|
|
34 |
generated_text = ""
|
35 |
if button_generate:
|
36 |
current_len = 0
|
37 |
+
#while current_len<maxlen:
|
38 |
|
39 |
+
# ηζζζ¬
|
40 |
+
generated_text += generate_text(input_text)
|
41 |
+
|
42 |
+
# ζΎη€Ίηζηζζ¬
|
43 |
+
output_text.success(generated_text)
|
44 |
+
#current_len += 30
|
45 |
|
46 |
if __name__ == "__main__":
|
47 |
# θΏθ‘εΊη¨η¨εΊ
|