gradio_demo / app.py
lvyb
demo
8c016fe
raw
history blame
No virus
613 Bytes
import os
import gradio as gr
from transformers import pipeline
sd_description = "ζ–‡ε­—η”Ÿζˆε›Ύη‰‡"
sd_examples = [["小猫"], ["cat"], ["dog"]]
sd_demo = gr.Interface.load("models/runwayml/stable-diffusion-v1-5", title='ζ–‡ε­—η”Ÿζˆε›Ύη‰‡', examples=sd_examples)
pipe = pipeline("image-classification")
examples = [[os.path.join(os.path.dirname(__file__), "lion.jpg")], [os.path.join(os.path.dirname(__file__), "cat.jpeg")]]
app = gr.Interface.from_pipeline(pipe, examples=examples, title='ε›Ύη‰‡θ―†εˆ«')
demo = gr.TabbedInterface([sd_demo, app], ["ζ–‡ε­—η”Ÿζˆε›Ύη‰‡", "ε›Ύη‰‡θ―†εˆ«"])
demo.launch()