build(config.yml): add more logging for docker build and test

This commit is contained in:
Krrish Dholakia 2024-01-31 10:58:25 -08:00
parent eea4325e60
commit ecc6855e49
2 changed files with 15 additions and 11 deletions

View file

@ -156,7 +156,7 @@ jobs:
--config /app/config.yaml \
--port 4000 \
--num_workers 8 \
--debug \
--detailed_debug \
--run_gunicorn \
- run:
name: Install curl and dockerize

View file

@ -107,19 +107,23 @@ async def chat_completion(session, key, model="gpt-4"):
],
}
async with session.post(url, headers=headers, json=data) as response:
status = response.status
response_text = await response.text()
for i in range(3):
try:
async with session.post(url, headers=headers, json=data) as response:
status = response.status
response_text = await response.text()
print(response_text)
print()
print(response_text)
print()
if status != 200:
raise Exception(
f"Request did not return a 200 status code: {status}. Response: {response_text}"
)
if status != 200:
raise Exception(
f"Request did not return a 200 status code: {status}. Response: {response_text}"
)
return await response.json()
return await response.json()
except:
pass
async def chat_completion_streaming(session, key, model="gpt-4"):