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() | |