File size: 687 Bytes
9261660
5a73fa0
9261660
5a73fa0
 
9261660
5a73fa0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from deepseek_vl import DeepSeekVL

# Initialize DeepSeek-VL model (CPU for free Spaces)
model = DeepSeekVL(model_path="deepseek-ai/deepseek-vl-7b", device="cpu")

def qa(image, question):
    # Run DeepSeek-VL inference: image + question -> answer
    return model.generate(image, question)

demo = gr.Interface(
    fn=qa,
    inputs=[
        gr.Image(type="pil", label="Upload Image"),
        gr.Textbox(label="Enter your question")
    ],
    outputs="text",
    title="DeepSeek-VL Multimodal QA Demo",
    description="Upload an image and enter a question. Experience DeepSeek-VL's vision-language capabilities."
)

if __name__ == "__main__":
    demo.launch()