()
| 72 | sampling_params=sampling_params) |
| 73 | |
| 74 | async def stream_results() -> AsyncGenerator[bytes, None]: |
| 75 | async for output in promise: |
| 76 | yield output.outputs[0].text_diff.encode("utf-8") |
| 77 | |
| 78 | if streaming: |
| 79 | return StreamingResponse(stream_results()) |