Matt09Miao commited on
Commit
99e6bfb
·
verified ·
1 Parent(s): 4b5220d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -6,12 +6,8 @@ from transformers import pipeline
6
  toxic_model = pipeline("text-classification", model="Matt09Miao/GP5_tweet_toxic")
7
 
8
 
9
- # text2story
10
- def text2story(input):
11
- pipe = pipeline("text-generation", model="pranavpsv/genre-story-generator-v2")
12
- tweet = pipe(input)
13
- return tweet
14
-
15
  # text2audio
16
  def text2audio(toxic_result):
17
  pipe = pipeline("text-to-audio", model="Matthijs/mms-tts-eng")
@@ -28,7 +24,7 @@ input = st.text_input("Please input your first word...")
28
  if input is not None:
29
  #Stage 1: Input to Tweet
30
  st.text('Generating a Tweet...')
31
- tweet = text2story(input)
32
  st.write(tweet)
33
 
34
  #Stage 2: Tweet Toxicity Analysis
 
6
  toxic_model = pipeline("text-classification", model="Matt09Miao/GP5_tweet_toxic")
7
 
8
 
9
+ text2tweet = pipeline("text-generation", model="pranavpsv/genre-story-generator-v2")
10
+
 
 
 
 
11
  # text2audio
12
  def text2audio(toxic_result):
13
  pipe = pipeline("text-to-audio", model="Matthijs/mms-tts-eng")
 
24
  if input is not None:
25
  #Stage 1: Input to Tweet
26
  st.text('Generating a Tweet...')
27
+ tweet = text2tweet(input)
28
  st.write(tweet)
29
 
30
  #Stage 2: Tweet Toxicity Analysis