zb9 commited on
Commit
5ee37e6
·
verified ·
1 Parent(s): 76d2f04

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # app.py
2
+ import gradio as gr
3
+ from colpali_engine.models import ColQwen2, ColQwen2Processor
4
+ import torch
5
+ import base64
6
+ from PIL import Image
7
+ import io
8
+
9
+ # Initialize model
10
+ model = ColQwen2.from_pretrained(
11
+ "vidore/colqwen2-v0.1",
12
+ torch_dtype=torch.bfloat16,
13
+ device_map="auto",
14
+ )
15
+ processor = ColQwen2Processor.from_pretrained("vidore/colqwen2-v0.1")
16
+ model = model.eval()