jerry3638 commited on
Commit
e8b140e
β€’
1 Parent(s): 9db8c40

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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(10), num_return_sequences=1)
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
- generated_text += generate_text(input_text)
41
-
42
- # ζ˜Ύη€Ίη”Ÿζˆηš„ζ–‡ζœ¬
43
- output_text.success(generated_text)
44
- current_len += 30
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
  # θΏθ‘ŒεΊ”η”¨η¨‹εΊ