replace await resp.json() with await parse_http_response(resp)

This commit is contained in:
hjc-puro 2025-05-03 06:36:05 -04:00
parent a8b59ccc9b
commit e06469f8c2
5 changed files with 52 additions and 6 deletions

View file

@ -5,6 +5,8 @@ import aiohttp
import gradio as gr
from transformers import AutoTokenizer
from atroposlib.utils.io import parse_http_response
def find_common_prefix(strings):
if not strings:
@ -46,7 +48,7 @@ async def check_for_batch():
while True:
async with aiohttp.ClientSession() as session:
async with session.get("http://localhost:8000/batch") as response:
data = await response.json()
data = await parse_http_response(response)
print(data)
if data["batch"] is not None:
return data["batch"]