Spaces:
Sleeping
Sleeping
import gradio as gr | |
# Use a pipeline as a high-level helper | |
from transformers import pipeline | |
pipe = pipeline("image-text-to-text", model="AIDC-AI/Ovis2-4B", trust_remote_code=True) | |
def launch(input): | |
out = pipe(input) | |
return out[0]['generated_text'] | |
iface = gr.Interface(launch, | |
inputs=gr.Image(type='pil'), | |
outputs="text") | |
iface.launch() |