Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,8 @@ import gradio as gr
|
|
| 6 |
# 1. CLOUD SETTINGS & SECURITY INITIALIZATION
|
| 7 |
# ==========================================
|
| 8 |
GROQ_API_KEY = os.environ.get("GROQ_API_KEY")
|
| 9 |
-
#
|
| 10 |
-
LLM_MODEL = "
|
| 11 |
|
| 12 |
# ==========================================
|
| 13 |
# 2. EXTENSIVE DATA TEMPLATE (Deep Research Source)
|
|
@@ -95,7 +95,7 @@ def practical_simulation_engine(pressure, temp, moisture):
|
|
| 95 |
{"role": "user", "content": user_prompt}
|
| 96 |
],
|
| 97 |
"temperature": 0.25,
|
| 98 |
-
"max_tokens": 1200
|
| 99 |
}
|
| 100 |
|
| 101 |
try:
|
|
@@ -103,7 +103,7 @@ def practical_simulation_engine(pressure, temp, moisture):
|
|
| 103 |
if res.status_code == 200:
|
| 104 |
return res.json()['choices'][0]['message']['content']
|
| 105 |
elif res.status_code == 429:
|
| 106 |
-
return "⏳ **Groq API Rate Limit Hit (429)**:
|
| 107 |
else:
|
| 108 |
return f"❌ Groq API Communication Failure ({res.status_code}): {res.text}"
|
| 109 |
except Exception as e:
|
|
|
|
| 6 |
# 1. CLOUD SETTINGS & SECURITY INITIALIZATION
|
| 7 |
# ==========================================
|
| 8 |
GROQ_API_KEY = os.environ.get("GROQ_API_KEY")
|
| 9 |
+
# Switched to the latest active high-tier production model on Groq
|
| 10 |
+
LLM_MODEL = "llama-3.3-70b-versatile"
|
| 11 |
|
| 12 |
# ==========================================
|
| 13 |
# 2. EXTENSIVE DATA TEMPLATE (Deep Research Source)
|
|
|
|
| 95 |
{"role": "user", "content": user_prompt}
|
| 96 |
],
|
| 97 |
"temperature": 0.25,
|
| 98 |
+
"max_tokens": 1200
|
| 99 |
}
|
| 100 |
|
| 101 |
try:
|
|
|
|
| 103 |
if res.status_code == 200:
|
| 104 |
return res.json()['choices'][0]['message']['content']
|
| 105 |
elif res.status_code == 429:
|
| 106 |
+
return "⏳ **Groq API Rate Limit Hit (429)**: Please wait 5-8 seconds and click transmit again to refresh the token window."
|
| 107 |
else:
|
| 108 |
return f"❌ Groq API Communication Failure ({res.status_code}): {res.text}"
|
| 109 |
except Exception as e:
|