Ai-Guru / app.py
enzer1992's picture
Update app.py
eae193c verified
raw
history blame contribute delete
428 Bytes
import gradio as gr
from transformers import AutoModelForImageTextToText
model = AutoModelForImageTextToText.from_pretrained("enzer1992/AI-Guru")
def generate_text(image):
inputs = processor(images=image, return_tensors="pt")
outputs = model.generate(**inputs)
return processor.decode(outputs[0], skip_special_tokens=True)
iface = gr.Interface(fn=generate_text, inputs=gr.Image(), outputs="text")
iface.launch()