Skip to content

Commit

Permalink
fix api server
Browse files Browse the repository at this point in the history
  • Loading branch information
renning22 committed Feb 26, 2024
1 parent 63d3d2c commit 8c7dd88
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
2 changes: 0 additions & 2 deletions fastchat/serve/openai_api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ async def get_gen_params(

if isinstance(messages, str):
prompt = messages
elif isinstance(messages, list) and len(messages) > 0 and isinstance(messages[0], str):
prompt = '. '.join(messages)
images = []
else:
for message in messages:
Expand Down
6 changes: 0 additions & 6 deletions fastchat/shale/shale.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,10 @@ async def dispatch(

class RequestLogger(BaseHTTPMiddleware):

async def set_body(self, request: Request, body: bytes):
async def receive() -> Message:
return {'type': 'http.request', 'body': body}
request._receive = receive

async def dispatch(
self, request: Request, call_next: RequestResponseEndpoint
) -> Response:
req_body = await request.body()
await self.set_body(request, req_body)
response = await call_next(request)
asyncio.create_task(log_request_to_db(request, req_body))
return response
Expand Down

0 comments on commit 8c7dd88

Please sign in to comment.