File size: 916 Bytes
b967a72
2b78143
 
 
 
 
b967a72
 
 
2b78143
 
b967a72
 
2b78143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b967a72
 
2b78143
 
b967a72
 
 
2b78143
b967a72
2b78143
b967a72
2b78143
b967a72
2b78143
b967a72
2b78143
 
b967a72
2b78143
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import io
import json
import base64
import requests

from fastapi import FastAPI, UploadFile, File
from fastapi.responses import JSONResponse
from PIL import Image

OLLAMA_URL = "http://localhost:11434/api/chat"
MODEL = "qwen3-vl:8b"

KNOWN_DISHES = [
    "Chicken Biryani",
    "Beef Karahi",
    "Chicken Karahi",
    "Nihari",
    "Haleem",
    "Daal Chawal",
    "Seekh Kebab",
    "Chapli Kebab",
    "Chicken Tikka",
    "Palak Paneer",
    "Aloo Gosht",
    "Chana Masala",
    "Raita",
    "Roti",
    "Naan",
    "Pulao",
    "Qeema",
]

PROMPT = f"""
Yeh ek Pakistani/South Asian food ki image hai.

Agar tumhein in mein se koi dish nazar aaye, to EXACT wahi naam use karo:

{", ".join(KNOWN_DISHES)}

Agar image mein koi aur dish hai jo is list mein nahi hai, to uska common naam do.

Agar multiple dishes hain to sab list karo.

Sirf JSON return karo:

{{"dishes":["dish1","dish2"]}}
"""

app = FastAPI()