Spaces:
Sleeping
Sleeping
Upload app.py
Browse filesLlama 3.2 90B Vision
app.py
CHANGED
@@ -30,6 +30,8 @@ def process_image(image_path, api_key, question):
|
|
30 |
image_b64 = base64.b64encode(compressed_image).decode()
|
31 |
assert len(image_b64) < 180_000, \
|
32 |
"Image is still too large after compression. Please try a smaller image."
|
|
|
|
|
33 |
prompt = f"{question} . Must reply to me in \"Traditional Chinese\"."
|
34 |
headers = {
|
35 |
"Authorization": f"Bearer {api_key}",
|
|
|
30 |
image_b64 = base64.b64encode(compressed_image).decode()
|
31 |
assert len(image_b64) < 180_000, \
|
32 |
"Image is still too large after compression. Please try a smaller image."
|
33 |
+
if not api_key:
|
34 |
+
api_key = os.getenv("YOUR_API_KEY")
|
35 |
prompt = f"{question} . Must reply to me in \"Traditional Chinese\"."
|
36 |
headers = {
|
37 |
"Authorization": f"Bearer {api_key}",
|