From 53790354987bc4dab99c1db75f36873e93097c63 Mon Sep 17 00:00:00 2001 From: Junyang Lin Date: Sun, 13 Aug 2023 12:41:26 +0800 Subject: [PATCH] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8bd0e07..81517bb 100644 --- a/README.md +++ b/README.md @@ -269,18 +269,18 @@ python web_demo.py ## API We provide methods to deploy local API based on OpenAI API (thanks to @hanpenggit). Before you start, install the required packages: -``` +```bash pip install fastapi uvicorn openai pydantic sse_starlette ``` Then run the command to deploy your API: -``` +```bash python openai_api.py ``` You can change your arguments, e.g., `-c` for checkpoint name or path, `--cpu-only` for CPU deployment, etc. If you meet problems launching your API deployment, updating the packages to the latest version can probably solve them. Using the API is also simple. See the example below: -``` +```python import openai openai.api_base = "http://localhost:8000/v1" openai.api_key = "none"