Matt09Miao commited on
Commit
d2b35f2
·
verified ·
1 Parent(s): e119c7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py CHANGED
@@ -1,3 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
  from transformers import pipeline
3
 
 
1
+ # function part
2
+ # Toxicity Analysis
3
+ def toxic(text_tweet):
4
+ image_model = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
5
+ text = image_to_text_model(url)[0]["generated_text"]
6
+ return text
7
+
8
+ # text2story
9
+ def text2story(text):
10
+ pipe = pipeline("text-generation", model="pranavpsv/genre-story-generator-v2")
11
+ story_text = pipe(text)[0]['generated_text']
12
+ return story_text
13
+
14
+ # text2audio
15
+ def text2audio(story_text):
16
+ pipe = pipeline("text-to-audio", model="Matthijs/mms-tts-eng")
17
+ audio_data = pipe(story_text)
18
+ return audio_data
19
+
20
+
21
  import streamlit as st
22
  from transformers import pipeline
23