Jeblest's picture
First app test
41e7b9b
raw
history blame contribute delete
481 Bytes
from inference import infer_single_image, model, processor
import gradio as gr
def generate_caption(image, prompt):
return infer_single_image(model, processor, image, prompt or "Describe this image.")
gr.Interface(
fn=generate_caption,
inputs=[
gr.Image(type="pil", label="Upload Image"),
gr.Textbox(label="Prompt (optional)")
],
outputs=gr.Textbox(label="Generated Caption"),
title="Qwen2.5-VL-7B Fine-tuned Image Captioning",
).launch()