Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 39064aa

Browse files
authored
Update neuralchat readme (#1286)
1 parent a9d6ad9 commit 39064aa

File tree

8 files changed

+57
-5
lines changed

8 files changed

+57
-5
lines changed

docker/README_chatbot.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cd itrex
1313
### Build Docker Image on CPU
1414
```bash
1515
cd itrex
16-
docker build -f docker/Dockerfile_chatbot --target cpu --network=host -t chatbot:latest .
16+
docker build -f docker/Dockerfile_chatbot --build-arg ITREX_VER=main --target cpu --network=host -t chatbot:latest .
1717
```
1818
If you need to use proxy, please use the following command
1919
```bash
@@ -35,7 +35,7 @@ docker pull intel/ai-tools:itrex-chatbot
3535
## Use Docker Image
3636
Utilize the docker container based on docker image.
3737
```bash
38-
docker run -itd --net=host --ipc=host intel/ai-tools:itrex-chatbot /bin/bash
38+
docker run -itd --net=host --ipc=host <image_id> /bin/bash
3939
docker exec -it <container_id> /bin/bash
4040
```
4141

docs/installation.md

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ The following prerequisites and requirements must be satisfied for a successful
6161
- GCC >= version 10 (on Linux)
6262
- Visual Studio (on Windows)
6363

64+
>**Note**: If your system only have python3 or you meet error `python: command not found`, please run `ln -sf $(which python3) /usr/bin/python`.
65+
66+
6467
### Install Intel Extension for Transformers
6568
```Bash
6669
git clone https://github.com/intel/intel-extension-for-transformers.git itrex

intel_extension_for_transformers/neural_chat/README.md

+27-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ NeuralChat is a powerful and flexible open framework that empowers you to effort
2424

2525
> NeuralChat is under active development. APIs are subject to change.
2626
27+
# System Requirements
28+
29+
Please make sure below basic system libraries are installed. If you want to try more features, please refer to [system requirements](../../docs/installation.md#system-requirements)
30+
31+
32+
```shell
33+
apt-get update
34+
apt-get install -y python3-pip
35+
apt-get install -y libgl1-mesa-glx
36+
```
37+
>**Note**: If your system only have python3 or you meet error `python: command not found`, please run `ln -sf $(which python3) /usr/bin/python`.
38+
39+
2740
# Installation
2841

2942
NeuralChat is under Intel Extension for Transformers, so ensure the installation of Intel Extension for Transformers first by following the [installation](../../docs/installation.md). After that, install additional dependency for NeuralChat per your device:
@@ -86,7 +99,7 @@ Then, interact with the model:
8699
```python
87100
import openai
88101
openai.api_key = "EMPTY"
89-
openai.base_url = 'http://127.0.0.1:80/v1/'
102+
openai.base_url = 'http://127.0.0.1:8000/v1/'
90103
response = openai.chat.completions.create(
91104
model="Intel/neural-chat-7b-v3-1",
92105
messages=[
@@ -96,10 +109,12 @@ response = openai.chat.completions.create(
96109
)
97110
print(response.choices[0].message.content)
98111
```
112+
>**Note**: When intel-extension-for-transformers <= 1.3.1, please try [command](#using-curl) below
113+
99114

100115
#### Using Curl
101116
```shell
102-
curl http://127.0.0.1:80/v1/chat/completions \
117+
curl http://127.0.0.1:8000/v1/chat/completions \
103118
-H "Content-Type: application/json" \
104119
-d '{
105120
"model": "Intel/neural-chat-7b-v3-1",
@@ -110,11 +125,17 @@ curl http://127.0.0.1:80/v1/chat/completions \
110125
}'
111126
```
112127

128+
>**Note**: When intel-extension-for-transformers <= 1.3.1, please use old command like:
129+
> ```shell
130+
> curl -X POST -H "Content-Type: application/json" -d '{"prompt": "Tell me about Intel Xeon Scalable Processors."}' http://127.0.0.1:8000/v1/chat/completions
131+
> ```
132+
133+
113134
#### Using Python Requests Library
114135
115136
```python
116137
import requests
117-
url = 'http://127.0.0.1:80/v1/chat/completions'
138+
url = 'http://127.0.0.1:8000/v1/chat/completions'
118139
headers = {'Content-Type': 'application/json'}
119140
data = '{"model": "Intel/neural-chat-7b-v3-1", "messages": [ \
120141
{"role": "system", "content": "You are a helpful assistant."}, \
@@ -124,6 +145,9 @@ response = requests.post(url, headers=headers, data=data)
124145
print(response.json())
125146
```
126147
148+
>**Note**: When intel-extension-for-transformers <= 1.3.1, please try [command](#using-curl) above
149+
150+
127151
## Langchain Extension APIs
128152

129153
Intel Extension for Transformers provides a comprehensive suite of Langchain-based extension APIs, including advanced retrievers, embedding models, and vector stores. These enhancements are carefully crafted to expand the capabilities of the original langchain API, ultimately boosting overall performance. This extension is specifically tailored to enhance the functionality and performance of RAG.

intel_extension_for_transformers/neural_chat/requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
accelerate
22
cchardet
3+
deepface
34
einops
45
evaluate
6+
ExifRead
57
fastapi==0.103.2
68
fschat==0.2.35
79
git+https://github.com/EleutherAI/lm-evaluation-harness.git@cc9778fbe4fa1a709be2abed9deb6180fd40e7e2
810
huggingface_hub
11+
intel-extension-for-transformers
912
intel_extension_for_pytorch==2.1.0
1013
neural-compressor
1114
neural_speed
@@ -15,6 +18,8 @@ optimum
1518
optimum-intel
1619
peft==0.6.2
1720
pydantic==1.10.13
21+
pydub
22+
pymysql
1823
python-dotenv
1924
python-multipart
2025
rouge_score

intel_extension_for_transformers/neural_chat/requirements_cpu.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
--extra-index-url https://download.pytorch.org/whl/cpu
22
cchardet
3+
deepface
34
einops
45
evaluate
6+
ExifRead
57
fastapi==0.103.2
68
fschat==0.2.32
79
git+https://github.com/EleutherAI/lm-evaluation-harness.git@cc9778fbe4fa1a709be2abed9deb6180fd40e7e2
10+
intel-extension-for-transformers
811
intel_extension_for_pytorch==2.1.0
912
neural-compressor
1013
neural_speed
@@ -13,6 +16,8 @@ optimum
1316
optimum-intel
1417
peft==0.6.2
1518
pydantic==1.10.13
19+
pydub
20+
pymysql
1621
python-dotenv
1722
python-multipart
1823
rouge_score

intel_extension_for_transformers/neural_chat/requirements_hpu.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
cchardet
2+
deepface
23
einops
34
evaluate
5+
ExifRead
46
fastapi==0.103.2
57
fschat==0.2.35
68
git+https://github.com/EleutherAI/lm-evaluation-harness.git@cc9778fbe4fa1a709be2abed9deb6180fd40e7e2
9+
intel-extension-for-transformers
710
intel_extension_for_pytorch
811
neural-compressor
912
neural_speed
1013
numpy==1.23.5
1114
optimum
1215
peft
1316
pydantic==1.10.13
17+
pydub
18+
pymysql
1419
python-dotenv
1520
python-multipart
1621
rouge_score

intel_extension_for_transformers/neural_chat/requirements_pc.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
--extra-index-url https://download.pytorch.org/whl/cpu
22
cchardet
3+
deepface
34
einops
45
evaluate
6+
ExifRead
57
fastapi==0.103.2
68
fschat==0.2.35
79
git+https://github.com/EleutherAI/lm-evaluation-harness.git@cc9778fbe4fa1a709be2abed9deb6180fd40e7e2
10+
intel-extension-for-transformers
811
neural-compressor
912
numpy==1.23.5
1013
optimum
1114
optimum-intel
1215
peft
1316
pydantic==1.10.13
17+
pydub
18+
pymysql
1419
python-dotenv
1520
python-multipart
1621
rouge_score

intel_extension_for_transformers/neural_chat/requirements_xpu.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
cchardet
2+
deepface
23
einops
34
evaluate
5+
ExifRead
46
fastapi==0.103.2
57
fschat==0.2.35
8+
intel-extension-for-transformers
69
neural-compressor
710
numpy==1.23.5
811
pydantic==1.10.13
12+
pydub
13+
pymysql
914
python-dotenv
1015
python-multipart
1116
rouge_score

0 commit comments

Comments
 (0)