update python from 3.9 to 3.12.8 to compat Internal error: unsupported operand type(s) for |: 'type'
Browse files- Dockerfile +1 -1
- clients/__pycache__/groq_client.cpython-312.pyc +0 -0
- clients/groq_client.py +1 -2
Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# 1. Use Hugging Face recommended Python image
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
# 2. Create non-root user (required by Hugging Face Spaces)
|
| 5 |
RUN useradd -m -u 1000 user
|
|
|
|
| 1 |
# 1. Use Hugging Face recommended Python image
|
| 2 |
+
FROM python:3.11
|
| 3 |
|
| 4 |
# 2. Create non-root user (required by Hugging Face Spaces)
|
| 5 |
RUN useradd -m -u 1000 user
|
clients/__pycache__/groq_client.cpython-312.pyc
CHANGED
|
Binary files a/clients/__pycache__/groq_client.cpython-312.pyc and b/clients/__pycache__/groq_client.cpython-312.pyc differ
|
|
|
clients/groq_client.py
CHANGED
|
@@ -172,7 +172,6 @@ class GroqClient:
|
|
| 172 |
]
|
| 173 |
|
| 174 |
# Try multiple models with fallback
|
| 175 |
-
# Add fallback models if compound models fail
|
| 176 |
models_to_try = [
|
| 177 |
"compound-beta-mini",
|
| 178 |
"llama-3.1-8b-instant",
|
|
@@ -200,7 +199,7 @@ class GroqClient:
|
|
| 200 |
except Exception as e:
|
| 201 |
# Check if it's a rate limit error
|
| 202 |
if "rate_limit_exceeded" in str(e) or "429" in str(e):
|
| 203 |
-
print(f"Rate limit hit for model {model}, trying fallback...")
|
| 204 |
continue
|
| 205 |
else:
|
| 206 |
# For other errors, return immediately
|
|
|
|
| 172 |
]
|
| 173 |
|
| 174 |
# Try multiple models with fallback
|
|
|
|
| 175 |
models_to_try = [
|
| 176 |
"compound-beta-mini",
|
| 177 |
"llama-3.1-8b-instant",
|
|
|
|
| 199 |
except Exception as e:
|
| 200 |
# Check if it's a rate limit error
|
| 201 |
if "rate_limit_exceeded" in str(e) or "429" in str(e):
|
| 202 |
+
# print(f"Rate limit hit for model {model}, trying fallback...")
|
| 203 |
continue
|
| 204 |
else:
|
| 205 |
# For other errors, return immediately
|