Spaces:
Sleeping
Sleeping
Lcmind commited on
Commit ·
f94d4dc
1
Parent(s): 582535d
fix: S-tier prompt - hex to color name, blur UI text, remove watermarks
Browse files- app/services/groq.py +25 -9
app/services/groq.py
CHANGED
|
@@ -65,15 +65,31 @@ Extract key information to create a poster that VISUALLY REPRESENTS what this co
|
|
| 65 |
"Content-Type": "application/json"
|
| 66 |
}
|
| 67 |
payload = {
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
async with httpx.AsyncClient(timeout=60.0) as client:
|
| 78 |
response = await client.post(url, headers=headers, json=payload)
|
| 79 |
response.raise_for_status()
|
|
|
|
| 65 |
"Content-Type": "application/json"
|
| 66 |
}
|
| 67 |
payload = {
|
| 68 |
+
"model": settings.groq_model, # 반드시 llama-3.2-11b-vision-preview 등 비전 모델이어야 함
|
| 69 |
+
"messages": [
|
| 70 |
+
{
|
| 71 |
+
"role": "system",
|
| 72 |
+
"content": "You are a world-class creative director and brand analyst."
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"role": "user",
|
| 76 |
+
"content": [
|
| 77 |
+
{
|
| 78 |
+
"type": "text",
|
| 79 |
+
"text": prompt
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"type": "image_url",
|
| 83 |
+
"image_url": {
|
| 84 |
+
"url": f"data:image/png;base64,{img_b64}"
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
]
|
| 88 |
+
}
|
| 89 |
+
],
|
| 90 |
+
"max_tokens": 1024,
|
| 91 |
+
"temperature": 0.2
|
| 92 |
+
}
|
| 93 |
async with httpx.AsyncClient(timeout=60.0) as client:
|
| 94 |
response = await client.post(url, headers=headers, json=payload)
|
| 95 |
response.raise_for_status()
|