diff --git a/docs/openapi.json b/docs/openapi.json index b37eb33a..d0f78061 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -2094,4 +2094,4 @@ "description": "Hugging Face Text Generation Inference API" } ] -} \ No newline at end of file +} diff --git a/docs/source/basic_tutorials/consuming_tgi.md b/docs/source/basic_tutorials/consuming_tgi.md index 6e4ec49c..b07e7219 100644 --- a/docs/source/basic_tutorials/consuming_tgi.md +++ b/docs/source/basic_tutorials/consuming_tgi.md @@ -88,7 +88,7 @@ There is also an async version of the client, `AsyncInferenceClient`, based on ` You can directly use the OpenAI [Python](https://github.com/openai/openai-python) or [JS](https://github.com/openai/openai-node) clients to interact with TGI. -Install the OpenAI Python package via pip. +Install the OpenAI Python package via pip. ```bash pip install openai @@ -145,7 +145,7 @@ def inference(message, history): stream=True, max_tokens=1024, ) - + for chunk in output: partial_message += chunk.choices[0].delta.content yield partial_message @@ -196,4 +196,4 @@ To serve both ChatUI and TGI in same environment, simply add your own endpoints } ``` -![ChatUI](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/chatui_screen.png) \ No newline at end of file +![ChatUI](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/chatui_screen.png)