File size: 428 Bytes
d81c651 eae193c e0a8fce d81c651 e0a8fce d81c651 e0a8fce d81c651 4fc42e6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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()
|