Dernière activité 1731289910

Jina-16.py Brut
1# Server
2with Deployment(uses=TokenStreamingExecutor, port=12345, protocol='grpc') as dep:
3 dep.block()
4
5
6# Client
7async 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)