最後活躍 1731289910

knox 已修改 1731289909. 還原成這個修訂版本

1 file changed, 14 insertions

Jina-16.py(檔案已創建)

@@ -0,0 +1,14 @@
1 + # Server
2 + with Deployment(uses=TokenStreamingExecutor, port=12345, protocol='grpc') as dep:
3 + dep.block()
4 +
5 +
6 + # Client
7 + async def main():
8 + client = Client(port=12345, protocol='grpc', asyncio=True)
9 + async for doc in client.stream_doc(
10 + on='/stream',
11 + inputs=PromptDocument(prompt='what is the capital of France ?', max_tokens=10),
12 + return_type=ModelOutputDocument,
13 + ):
14 + print(doc.generated_text)
上一頁 下一頁