test / app.py
andreeabodea's picture
Update app.py
1169a01 verified
raw
history blame
547 Bytes
"""import gradio as gr
from transformers import pipeline
pipe = pipeline("image-to-text",
model="./models/Salesforce/blip-image-captioning-base")
def launch(input):
out = pipe(input)
return out[0]['generated_text']
iface = gr.Interface(launch,
inputs=gr.Image(type='pil'),
outputs="text")
iface.launch()
"""
import gradio as gr
def greet(name):
return "Hello, " + name + "!"
demo = gr.Interface(
fn=greet,
inputs=["text"],
outputs=["text"],
)
demo.launch()