Update app.py
Browse files
app.py
CHANGED
@@ -24,19 +24,24 @@ 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()
|
31 |
|
32 |
return generated_text
|
33 |
|
|
|
34 |
if button_generate:
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
40 |
|
41 |
if __name__ == "__main__":
|
42 |
# θΏθ‘εΊη¨η¨εΊ
|
|
|
24 |
generator = pipeline("text-generation", model)
|
25 |
|
26 |
# ηζζζ¬
|
27 |
+
output = generator(input_text, max_length=int(10), num_return_sequences=1)
|
28 |
|
29 |
# ζεηζηζζ¬
|
30 |
generated_text = output[0]["generated_text"].strip()
|
31 |
|
32 |
return generated_text
|
33 |
|
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 |
# θΏθ‘εΊη¨η¨εΊ
|