mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-04 08:16:42 +08:00
[BugFix] fix multinode deployment (#2977)
This commit is contained in:
@@ -19,7 +19,7 @@ import time
|
||||
import traceback
|
||||
import uuid
|
||||
from typing import List, Optional
|
||||
|
||||
import numpy as np
|
||||
import aiozmq
|
||||
import msgpack
|
||||
from aiozmq import zmq
|
||||
@@ -48,11 +48,16 @@ class OpenAIServingChat:
|
||||
OpenAI-style chat completions serving
|
||||
"""
|
||||
|
||||
def __init__(self, engine_client, pid, dist_init_ip):
|
||||
def __init__(self, engine_client, pid, ips):
|
||||
self.engine_client = engine_client
|
||||
self.pid = pid
|
||||
self.master_ip = dist_init_ip
|
||||
self.master_ip = ips
|
||||
self.host_ip = get_host_ip()
|
||||
if self.master_ip is not None:
|
||||
if isinstance(self.master_ip, list):
|
||||
self.master_ip = self.master_ip[0]
|
||||
else:
|
||||
self.master_ip = self.master_ip.split(",")[0]
|
||||
|
||||
def _check_master(self):
|
||||
if self.master_ip is None:
|
||||
@@ -80,6 +85,8 @@ class OpenAIServingChat:
|
||||
current_req_dict = request.to_dict_for_infer(request_id)
|
||||
current_req_dict["arrival_time"] = time.time()
|
||||
prompt_token_ids = self.engine_client.format_and_add_data(current_req_dict)
|
||||
if isinstance(prompt_token_ids, np.ndarray):
|
||||
prompt_token_ids = prompt_token_ids.tolist()
|
||||
except Exception as e:
|
||||
return ErrorResponse(code=400, message=str(e))
|
||||
|
||||
|
Reference in New Issue
Block a user