Update app.py
Browse files
app.py
CHANGED
@@ -106,7 +106,7 @@ async def run_samba_api_inference(query, system_prompt = None, ignore_context=Fa
|
|
106 |
return "Invalid Key! Please make sure you have a valid SambaCloud key from https://cloud.sambanova.ai/."
|
107 |
if post_response.status_code in {429, 504}:
|
108 |
await asyncio.sleep(num_seconds_to_sleep)
|
109 |
-
return await run_samba_api_inference(query, random.choice(BACKUP_KEYS)) # Retry the request
|
110 |
else:
|
111 |
print(f"Request failed with status code: {post_response.status_code}. Error: {e}")
|
112 |
return "Invalid Key! Please make sure you have a valid SambaCloud key from https://cloud.sambanova.ai/."
|
|
|
106 |
return "Invalid Key! Please make sure you have a valid SambaCloud key from https://cloud.sambanova.ai/."
|
107 |
if post_response.status_code in {429, 504}:
|
108 |
await asyncio.sleep(num_seconds_to_sleep)
|
109 |
+
return await run_samba_api_inference(query, over_ride_key=random.choice(BACKUP_KEYS)) # Retry the request
|
110 |
else:
|
111 |
print(f"Request failed with status code: {post_response.status_code}. Error: {e}")
|
112 |
return "Invalid Key! Please make sure you have a valid SambaCloud key from https://cloud.sambanova.ai/."
|