Matt09Miao commited on
Commit
f2d3f43
·
verified ·
1 Parent(s): 2b827d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,7 +9,7 @@ toxic_model = pipeline("text-classification", model="Matt09Miao/GP5_tweet_toxic"
9
  # text2story
10
  def text2story(text):
11
  pipe = pipeline("text-generation", model="distilbert/distilgpt2")
12
- tweet_text_text = pipe(text)[0]['generated_text']
13
  return tweet_text
14
 
15
  # text2audio
@@ -29,7 +29,7 @@ if input is not None:
29
 
30
  #Stage 1: Input to Tweet
31
  st.text('Generating a Tweet...')
32
- tweet = text2story(input,max_length=45, num_return_sequences=01)
33
  st.write(tweet)
34
 
35
  #Stage 2: Tweet Toxicity Analysis
 
9
  # text2story
10
  def text2story(text):
11
  pipe = pipeline("text-generation", model="distilbert/distilgpt2")
12
+ tweet_text = pipe(text)[0]['generated_text']
13
  return tweet_text
14
 
15
  # text2audio
 
29
 
30
  #Stage 1: Input to Tweet
31
  st.text('Generating a Tweet...')
32
+ tweet = text2story(input)
33
  st.write(tweet)
34
 
35
  #Stage 2: Tweet Toxicity Analysis