Isgrassmann commited on
Commit
b11dbf8
·
1 Parent(s): 1a02476

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -5
app.py CHANGED
@@ -1,7 +1,25 @@
1
- from transformers import AutoTokenizer, AutoModel
 
2
 
3
- tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
4
- model = AutoModel.from_pretrained("bert-base-uncased")
 
 
 
 
5
 
6
- inputs = tokenizer("Hello world!", return_tensors="pt")
7
- outputs = model(**inputs)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ # Load the Stable Diffusion TTS model
5
+ tts_demo = gr.Interface.load(
6
+ "models/runwayml/stable-diffusion-v1-5",
7
+ title=None,
8
+ description="Give me something to paint!"
9
+ )
10
 
11
+ # Load the text-to-image prompt generator model
12
+ stt_demo = gr.Interface.load(
13
+ "models/succinctly/text2image-prompt-generator",
14
+ title=None,
15
+ description="Let me try to guess what you're saying!"
16
+ )
17
+
18
+ # Load the image classification model
19
+ image_classification = pipeline("image-classification")
20
+
21
+ # Create the tabbed interface
22
+ demo = gr.TabbedInterface([tts_demo, stt_demo, gr.Interface.from_pipeline(image_classification)], ["Paint", "Text", "Image"])
23
+
24
+ # Launch the interface
25
+ demo.launch()