Skip to content

Commit

Permalink
错误的依赖已经修改,技术文档正在森和
Browse files Browse the repository at this point in the history
  • Loading branch information
zRzRzRzRzRzRzR committed Feb 2, 2024
1 parent 722eebe commit 7612824
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ pip install -r requirements.txt

+ `transformers` 库版本应该 `4.36.2` 以及以上的版本 ,`torch` 库版本应为 2.1.0 及以上的版本,以获得最佳的推理性能。
+ 为了保证 `torch` 的版本正确,请严格按照 [官方文档](https://pytorch.org/get-started/locally/) 的说明安装。
+ `gradio` 库版本应该为 `4.13` 以上的版本。

#### 从本地加载模型

Expand All @@ -164,16 +163,11 @@ git https://huggingface.co/thu-coai/CharacterGLM-6B

### 网页版对话 Demo

可以通过以下命令启动基于 Gradio 的网页版 demo:
可以通过以下命令启动基于 Streamlit 的[网页版 demo](basic_demo/web_demo_streamlit.py)

```shell
python web_demo_gradio.py
```

可以通过以下命令启动基于 Streamlit 的网页版 demo:

```shell
streamlit run web_demo_streamlit.py
streamlit run basic_demo/web_demo_streamlit.py
```

网页版 demo 会运行一个 Web Server,并输出地址。在浏览器中打开输出的地址即可使用。 经测试,基于 Streamlit 的网页版 Demo 会更流畅。
Expand All @@ -183,7 +177,7 @@ streamlit run web_demo_streamlit.py
运行仓库中 [cli_demo.py](basic_demo/cli_demo.py)

```shell
python cli_demo.py
python basic_demo/cli_demo.py
```

程序会在命令行中进行交互式的对话,在命令行中输入指示并回车即可生成回复,输入 `clear` 可以清空对话历史,输入 `stop` 终止程序。
Expand Down
13 changes: 3 additions & 10 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ pip install -r requirements.txt
above to obtain the best inference performance.
+ In order to ensure that the version of `torch` is correct, please strictly follow the instructions
of [official documentation](https://pytorch.org/get-started/locally/) for installation.
+ The `gradio` library version should be the `4.13` version and above.

#### Load model from local

Expand All @@ -217,16 +216,10 @@ git clone https://huggingface.co/thu-coai/CharacterGLM-6B

### Web version dialogue Demo

You can start the Gradio-based web version demo with the following command:
You can start the [web demo](basic_demo/web_demo_streamlit.py) based on Streamlit with the following command:

```shell
python web_demo_gradio.py
```

You can start the web version demo based on Streamlit with the following command:

```shell
streamlit run web_demo_streamlit.py
streamlit run basic_demo/web_demo_streamlit.py
```

The web version demo will run a Web Server and output the address. Open the output address in a browser to use it. After
Expand All @@ -237,7 +230,7 @@ testing, the web version Demo based on Streamlit will be smoother.
Run [cli_demo.py](basic_demo/cli_demo.py) in the warehouse:

```shell
python cli_demo.py
python basic_demo/cli_demo.py
```

The program will conduct an interactive conversation in the command line. Enter instructions in the command line and
Expand Down
8 changes: 6 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# basic requirements

protobuf>=4.25.2
transformers>=4.36.2
transformers>=4.37.2
tokenizers>=0.15.0
cpm_kernels>=1.0.11

torch>=2.1.0
sentencepiece>=0.1.99
sentence_transformers>=2.3.1
accelerate>=0.26.1
cpm_kernels>=1.0.11

streamlit>=1.30.0
loguru~=0.7.2
mdtex2html>=1.2.0
Expand Down

0 comments on commit 7612824

Please sign in to comment.