You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: python/llm/example/CPU/HF-Transformers-AutoModels/Model/chatglm2/README.md
+8-28
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,7 @@ In this directory, you will find examples on how you could apply IPEX-LLM INT4 o
5
5
## 0. Requirements
6
6
To run these examples with IPEX-LLM, we have some recommended requirements for your machine, please refer to [here](../README.md#recommended-requirements) for more information.
7
7
8
-
## Example 1: Predict Tokens using `generate()` API
9
-
In the example [generate.py](./generate.py), we show a basic use case for a ChatGLM2 model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations.
10
-
### 1. Install
8
+
## 1. Install
11
9
We suggest using conda to manage environment:
12
10
13
11
On Linux:
@@ -29,7 +27,11 @@ conda activate llm
29
27
pip install --pre --upgrade ipex-llm[all]
30
28
```
31
29
32
-
### 2. Run
30
+
## 2. Run
31
+
32
+
### Example 1: Predict Tokens using `generate()` API
33
+
In the example [generate.py](./generate.py), we show a basic use case for a ChatGLM2 model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations.
答: Artificial Intelligence (AI) refers to the ability of a computer or machine to perform tasks that typically require human-like intelligence, such as understanding language, recognizing patterns
89
91
```
90
92
91
-
## Example 2: Stream Chat using `stream_chat()` API
93
+
###Example 2: Stream Chat using `stream_chat()` API
92
94
In the example [streamchat.py](./streamchat.py), we show a basic use case for a ChatGLM2 model to stream chat, with IPEX-LLM INT4 optimizations.
93
-
### 1. Install
94
-
We suggest using conda to manage environment:
95
-
96
-
On Linux:
97
-
98
-
```bash
99
-
conda create -n llm python=3.11 # recommend to use Python 3.11
100
-
conda activate llm
101
-
102
-
# install the latest ipex-llm nightly build with 'all' option
Copy file name to clipboardexpand all lines: python/llm/example/CPU/HF-Transformers-AutoModels/Model/chatglm3/README.md
+8-28
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,7 @@ In this directory, you will find examples on how you could apply IPEX-LLM INT4 o
5
5
## 0. Requirements
6
6
To run these examples with IPEX-LLM, we have some recommended requirements for your machine, please refer to [here](../README.md#recommended-requirements) for more information.
7
7
8
-
## Example 1: Predict Tokens using `generate()` API
9
-
In the example [generate.py](./generate.py), we show a basic use case for a ChatGLM3 model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations.
10
-
### 1. Install
8
+
## 1. Install
11
9
We suggest using conda to manage environment:
12
10
13
11
On Linux:
@@ -29,7 +27,11 @@ conda activate llm
29
27
pip install --pre --upgrade ipex-llm[all]
30
28
```
31
29
32
-
### 2. Run
30
+
## 2. Run
31
+
32
+
### Example 1: Predict Tokens using `generate()` API
33
+
In the example [generate.py](./generate.py), we show a basic use case for a ChatGLM3 model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations.
AI stands for Artificial Intelligence. It refers to the development of computer systems that can perform tasks that would normally require human intelligence, such as recognizing speech or making
90
92
```
91
93
92
-
## Example 2: Stream Chat using `stream_chat()` API
94
+
###Example 2: Stream Chat using `stream_chat()` API
93
95
In the example [streamchat.py](./streamchat.py), we show a basic use case for a ChatGLM3 model to stream chat, with IPEX-LLM INT4 optimizations.
94
-
### 1. Install
95
-
We suggest using conda to manage environment:
96
-
97
-
On Linux:
98
-
99
-
```bash
100
-
conda create -n llm python=3.11 # recommend to use Python 3.11
101
-
conda activate llm
102
-
103
-
# install the latest ipex-llm nightly build with 'all' option
Copy file name to clipboardexpand all lines: python/llm/example/CPU/HF-Transformers-AutoModels/Model/glm4/README.md
+9-34
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,7 @@ In this directory, you will find examples on how you could apply IPEX-LLM INT4 o
5
5
## 0. Requirements
6
6
To run these examples with IPEX-LLM, we have some recommended requirements for your machine, please refer to [here](../README.md#recommended-requirements) for more information.
7
7
8
-
## Example 1: Predict Tokens using `generate()` API
9
-
In the example [generate.py](./generate.py), we show a basic use case for a GLM-4 model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations.
### Example 1: Predict Tokens using `generate()` API
38
+
In the example [generate.py](./generate.py), we show a basic use case for a GLM-4 model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations.
Artificial Intelligence (AI) refers to the simulation of human intelligence in machines that are programmed to think like humans and mimic their actions. The term "art
96
98
```
97
99
98
-
## Example 2: Stream Chat using `stream_chat()` API
100
+
###Example 2: Stream Chat using `stream_chat()` API
99
101
In the example [streamchat.py](./streamchat.py), we show a basic use case for a GLM-4 model to stream chat, with IPEX-LLM INT4 optimizations.
100
-
### 1. Install
101
-
We suggest using conda to manage environment:
102
-
103
-
On Linux:
104
-
105
-
```bash
106
-
conda create -n llm python=3.11 # recommend to use Python 3.11
107
-
conda activate llm
108
-
109
-
# install the latest ipex-llm nightly build with 'all' option
Copy file name to clipboardexpand all lines: python/llm/example/GPU/HF-Transformers-AutoModels/Model/chatglm2/README.md
+13-106
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,8 @@ In this directory, you will find examples on how you could apply IPEX-LLM INT4 o
5
5
## 0. Requirements
6
6
To run these examples with IPEX-LLM on Intel GPUs, we have some recommended requirements for your machine, please refer to [here](../../../README.md#requirements) for more information.
7
7
8
-
## Example 1: Predict Tokens using `generate()` API
9
-
In the example [generate.py](./generate.py), we show a basic use case for a ChatGLM2 model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations on Intel GPUs.
###2. Configures OneAPI environment variables for Linux
28
+
## 2. Configures OneAPI environment variables for Linux
32
29
33
30
> [!NOTE]
34
31
> Skip this step if you are running on Windows.
@@ -39,9 +36,9 @@ This is a required step on Linux for APT or offline installed oneAPI. Skip this
39
36
source /opt/intel/oneapi/setvars.sh
40
37
```
41
38
42
-
###3. Runtime Configurations
39
+
## 3. Runtime Configurations
43
40
For optimal performance, it is recommended to set several environment variables. Please check out the suggestions based on your device.
44
-
####3.1 Configurations for Linux
41
+
### 3.1 Configurations for Linux
45
42
<details>
46
43
47
44
<summary>For Intel Arc™ A-Series Graphics and Intel Data Center GPU Flex Series</summary>
@@ -78,7 +75,7 @@ export BIGDL_LLM_XMX_DISABLED=1
78
75
79
76
</details>
80
77
81
-
####3.2 Configurations for Windows
78
+
### 3.2 Configurations for Windows
82
79
<details>
83
80
84
81
<summary>For Intel iGPU</summary>
@@ -103,7 +100,11 @@ set SYCL_CACHE_PERSISTENT=1
103
100
> [!NOTE]
104
101
> For the first time that each model runs on Intel iGPU/Intel Arc™ A300-Series or Pro A60, it may take several minutes to compile.
105
102
106
-
### 4. Running examples
103
+
## 4. Running examples
104
+
105
+
### Example 1: Predict Tokens using `generate()` API
106
+
In the example [generate.py](./generate.py), we show a basic use case for a ChatGLM2 model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations on Intel GPUs.
答: Artificial Intelligence (AI) refers to the ability of a computer or machine to perform tasks that typically require human-like intelligence, such as understanding language, recognizing patterns
140
141
```
141
142
142
-
## Example 2: Stream Chat using `stream_chat()` API
143
+
###Example 2: Stream Chat using `stream_chat()` API
143
144
In the example [streamchat.py](./streamchat.py), we show a basic use case for a ChatGLM2 model to stream chat, with IPEX-LLM INT4 optimizations.
144
-
### 1. Install
145
-
#### 1.1 Installation on Linux
146
-
We suggest using conda to manage environment:
147
-
```bash
148
-
conda create -n llm python=3.11
149
-
conda activate llm
150
-
# below command will install intel_extension_for_pytorch==2.1.10+xpu as default
0 commit comments