Spaces:
Runtime error
Runtime error
Commit
·
f245369
1
Parent(s):
036eb61
fixing model
Browse files
main.py
CHANGED
|
@@ -10,7 +10,7 @@ from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration, Qwen
|
|
| 10 |
|
| 11 |
app = FastAPI()
|
| 12 |
|
| 13 |
-
checkpoint = "Qwen/Qwen2-VL-
|
| 14 |
min_pixels = 256 * 28 * 28
|
| 15 |
max_pixels = 1280 * 28 * 28
|
| 16 |
processor = AutoProcessor.from_pretrained(
|
|
@@ -86,7 +86,7 @@ async def upload_and_encode_image(file: UploadFile = File(...)):
|
|
| 86 |
raise HTTPException(status_code=400, detail=f"Invalid file: {e}")
|
| 87 |
|
| 88 |
@app.get("/predict")
|
| 89 |
-
def
|
| 90 |
"""
|
| 91 |
Generates a description for an image using the Qwen-2-VL model.
|
| 92 |
|
|
|
|
| 10 |
|
| 11 |
app = FastAPI()
|
| 12 |
|
| 13 |
+
checkpoint = "Qwen/Qwen2-VL-2B-Instruct"
|
| 14 |
min_pixels = 256 * 28 * 28
|
| 15 |
max_pixels = 1280 * 28 * 28
|
| 16 |
processor = AutoProcessor.from_pretrained(
|
|
|
|
| 86 |
raise HTTPException(status_code=400, detail=f"Invalid file: {e}")
|
| 87 |
|
| 88 |
@app.get("/predict")
|
| 89 |
+
def predict(image_url: str = Query(...), prompt: str = Query(...)):
|
| 90 |
"""
|
| 91 |
Generates a description for an image using the Qwen-2-VL model.
|
| 92 |
|