mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-07 01:22:59 +08:00
[llm] update docs
This commit is contained in:
@@ -144,7 +144,7 @@ health接口:(模型是否准备好推理)
|
|||||||
from fastdeploy_client.chatbot import ChatBot
|
from fastdeploy_client.chatbot import ChatBot
|
||||||
|
|
||||||
hostname = "127.0.0.1" # 服务部署的hostname
|
hostname = "127.0.0.1" # 服务部署的hostname
|
||||||
port = 8000 # 服务配置的GRPC_PORT
|
port = 8811 # 服务配置的GRPC_PORT
|
||||||
|
|
||||||
chatbot = ChatBot(hostname=hostname, port=port)
|
chatbot = ChatBot(hostname=hostname, port=port)
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ result = chatbot.generate("你好", topp=0.8, max_dec_len=128, timeout=120)
|
|||||||
print(result)
|
print(result)
|
||||||
|
|
||||||
# 流式接口
|
# 流式接口
|
||||||
chatbot = ChatBot(hostname=hostname, port=port, model_id=model_id, mode=mode)
|
chatbot = ChatBot(hostname=hostname, port=port)
|
||||||
stream_result = chatbot.stream_generate("你好", max_dec_len=128, timeout=120)
|
stream_result = chatbot.stream_generate("你好", max_dec_len=128, timeout=120)
|
||||||
for res in stream_result:
|
for res in stream_result:
|
||||||
print(res)
|
print(res)
|
||||||
|
Reference in New Issue
Block a user