File size: 550 Bytes
ffea36f 9b582e7 ffea36f 9b582e7 dcf5937 ffea36f 9b582e7 ffea36f 52189cc ffea36f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
from transformers import AutoProcessor, AutoModelForVisualQuestionAnswering, AutoModelForCausalLM, AutoTokenizer
from PIL import Image
import torch
model = AutoModelForCausalLM.from_pretrained("microsoft/git-base-vqav2")
model_path = "microsoft/git-base-vqav2"
dataset_name = "Multimodal-Fatima/OK-VQA_train"
tokenizer = AutoTokenizer.from_pretrained(model_path)
def main():
demo = gr.Interface(
fn=main,
inputs=[gr.Slider(1, len(questions), step=1)],
outputs=["image", "text", "text"],
)
demo.launch(share=True)
|