Spaces:
Runtime error
Runtime error
| 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() | |