Update README.md
Browse files
README.md
CHANGED
@@ -1,433 +1,7 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|:---:|:---:|
|
9 |
-
|![Image1](https://github.com/oobabooga/screenshots/raw/main/print_default.png) | ![Image2](https://github.com/oobabooga/screenshots/raw/main/print_parameters.png) |
|
10 |
-
|
11 |
-
## Features
|
12 |
-
|
13 |
-
* 3 interface modes: default (two columns), notebook, and chat.
|
14 |
-
* Multiple model backends: [Transformers](https://github.com/huggingface/transformers), [llama.cpp](https://github.com/ggerganov/llama.cpp) (through [llama-cpp-python](https://github.com/abetlen/llama-cpp-python)), [ExLlamaV2](https://github.com/turboderp/exllamav2), [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ), [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), [GPTQ-for-LLaMa](https://github.com/qwopqwop200/GPTQ-for-LLaMa), [CTransformers](https://github.com/marella/ctransformers), [QuIP#](https://github.com/Cornell-RelaxML/quip-sharp).
|
15 |
-
* Dropdown menu for quickly switching between different models.
|
16 |
-
* Large number of extensions (built-in and user-contributed), including Coqui TTS for realistic voice outputs, Whisper STT for voice inputs, translation, [multimodal pipelines](https://github.com/oobabooga/text-generation-webui/tree/main/extensions/multimodal), vector databases, Stable Diffusion integration, and a lot more. See [the wiki](https://github.com/oobabooga/text-generation-webui/wiki/07-%E2%80%90-Extensions) and [the extensions directory](https://github.com/oobabooga/text-generation-webui-extensions) for details.
|
17 |
-
* [Chat with custom characters](https://github.com/oobabooga/text-generation-webui/wiki/03-%E2%80%90-Parameters-Tab#character).
|
18 |
-
* Precise chat templates for instruction-following models, including Llama-2-chat, Alpaca, Vicuna, Mistral.
|
19 |
-
* LoRA: train new LoRAs with your own data, load/unload LoRAs on the fly for generation.
|
20 |
-
* Transformers library integration: load models in 4-bit or 8-bit precision through bitsandbytes, use llama.cpp with transformers samplers (`llamacpp_HF` loader), CPU inference in 32-bit precision using PyTorch.
|
21 |
-
* OpenAI-compatible API server with Chat and Completions endpoints -- see the [examples](https://github.com/oobabooga/text-generation-webui/wiki/12-%E2%80%90-OpenAI-API#examples).
|
22 |
-
|
23 |
-
## How to install
|
24 |
-
|
25 |
-
1) Clone or [download](https://github.com/oobabooga/text-generation-webui/archive/refs/heads/main.zip) the repository.
|
26 |
-
2) Run the `start_linux.sh`, `start_windows.bat`, `start_macos.sh`, or `start_wsl.bat` script depending on your OS.
|
27 |
-
3) Select your GPU vendor when asked.
|
28 |
-
4) Once the installation ends, browse to `http://localhost:7860/?__theme=dark`.
|
29 |
-
5) Have fun!
|
30 |
-
|
31 |
-
To restart the web UI in the future, just run the `start_` script again. This script creates an `installer_files` folder where it sets up the project's requirements. In case you need to reinstall the requirements, you can simply delete that folder and start the web UI again.
|
32 |
-
|
33 |
-
The script accepts command-line flags. Alternatively, you can edit the `CMD_FLAGS.txt` file with a text editor and add your flags there.
|
34 |
-
|
35 |
-
To get updates in the future, run `update_wizard_linux.sh`, `update_wizard_windows.bat`, `update_wizard_macos.sh`, or `update_wizard_wsl.bat`.
|
36 |
-
|
37 |
-
<details>
|
38 |
-
<summary>
|
39 |
-
Setup details and information about installing manually
|
40 |
-
</summary>
|
41 |
-
|
42 |
-
### One-click-installer
|
43 |
-
|
44 |
-
The script uses Miniconda to set up a Conda environment in the `installer_files` folder.
|
45 |
-
|
46 |
-
If you ever need to install something manually in the `installer_files` environment, you can launch an interactive shell using the cmd script: `cmd_linux.sh`, `cmd_windows.bat`, `cmd_macos.sh`, or `cmd_wsl.bat`.
|
47 |
-
|
48 |
-
* There is no need to run any of those scripts (`start_`, `update_wizard_`, or `cmd_`) as admin/root.
|
49 |
-
* To install the requirements for extensions, you can use the `extensions_reqs` script for your OS. At the end, this script will install the main requirements for the project to make sure that they take precedence in case of version conflicts.
|
50 |
-
* For additional instructions about AMD and WSL setup, consult [the documentation](https://github.com/oobabooga/text-generation-webui/wiki).
|
51 |
-
* For automated installation, you can use the `GPU_CHOICE`, `USE_CUDA118`, `LAUNCH_AFTER_INSTALL`, and `INSTALL_EXTENSIONS` environment variables. For instance: `GPU_CHOICE=A USE_CUDA118=FALSE LAUNCH_AFTER_INSTALL=FALSE INSTALL_EXTENSIONS=TRUE ./start_linux.sh`.
|
52 |
-
|
53 |
-
### Manual installation using Conda
|
54 |
-
|
55 |
-
Recommended if you have some experience with the command-line.
|
56 |
-
|
57 |
-
#### 0. Install Conda
|
58 |
-
|
59 |
-
https://docs.conda.io/en/latest/miniconda.html
|
60 |
-
|
61 |
-
On Linux or WSL, it can be automatically installed with these two commands ([source](https://educe-ubc.github.io/conda.html)):
|
62 |
-
|
63 |
-
```
|
64 |
-
curl -sL "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" > "Miniconda3.sh"
|
65 |
-
bash Miniconda3.sh
|
66 |
-
```
|
67 |
-
|
68 |
-
#### 1. Create a new conda environment
|
69 |
-
|
70 |
-
```
|
71 |
-
conda create -n textgen python=3.11
|
72 |
-
conda activate textgen
|
73 |
-
```
|
74 |
-
|
75 |
-
#### 2. Install Pytorch
|
76 |
-
|
77 |
-
| System | GPU | Command |
|
78 |
-
|--------|---------|---------|
|
79 |
-
| Linux/WSL | NVIDIA | `pip3 install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/cu121` |
|
80 |
-
| Linux/WSL | CPU only | `pip3 install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/cpu` |
|
81 |
-
| Linux | AMD | `pip3 install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/rocm5.6` |
|
82 |
-
| MacOS + MPS | Any | `pip3 install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1` |
|
83 |
-
| Windows | NVIDIA | `pip3 install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/cu121` |
|
84 |
-
| Windows | CPU only | `pip3 install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1` |
|
85 |
-
|
86 |
-
The up-to-date commands can be found here: https://pytorch.org/get-started/locally/.
|
87 |
-
|
88 |
-
For NVIDIA, you also need to install the CUDA runtime libraries:
|
89 |
-
|
90 |
-
```
|
91 |
-
conda install -y -c "nvidia/label/cuda-12.1.1" cuda-runtime
|
92 |
-
```
|
93 |
-
|
94 |
-
If you need `nvcc` to compile some library manually, replace the command above with
|
95 |
-
|
96 |
-
```
|
97 |
-
conda install -y -c "nvidia/label/cuda-12.1.1" cuda
|
98 |
-
```
|
99 |
-
|
100 |
-
#### 3. Install the web UI
|
101 |
-
|
102 |
-
```
|
103 |
-
git clone https://github.com/oobabooga/text-generation-webui
|
104 |
-
cd text-generation-webui
|
105 |
-
pip install -r <requirements file according to table below>
|
106 |
-
```
|
107 |
-
|
108 |
-
Requirements file to use:
|
109 |
-
|
110 |
-
| GPU | CPU | requirements file to use |
|
111 |
-
|--------|---------|---------|
|
112 |
-
| NVIDIA | has AVX2 | `requirements.txt` |
|
113 |
-
| NVIDIA | no AVX2 | `requirements_noavx2.txt` |
|
114 |
-
| AMD | has AVX2 | `requirements_amd.txt` |
|
115 |
-
| AMD | no AVX2 | `requirements_amd_noavx2.txt` |
|
116 |
-
| CPU only | has AVX2 | `requirements_cpu_only.txt` |
|
117 |
-
| CPU only | no AVX2 | `requirements_cpu_only_noavx2.txt` |
|
118 |
-
| Apple | Intel | `requirements_apple_intel.txt` |
|
119 |
-
| Apple | Apple Silicon | `requirements_apple_silicon.txt` |
|
120 |
-
|
121 |
-
### Start the web UI
|
122 |
-
|
123 |
-
```
|
124 |
-
conda activate textgen
|
125 |
-
cd text-generation-webui
|
126 |
-
python server.py
|
127 |
-
```
|
128 |
-
|
129 |
-
Then browse to
|
130 |
-
|
131 |
-
`http://localhost:7860/?__theme=dark`
|
132 |
-
|
133 |
-
##### AMD GPU on Windows
|
134 |
-
|
135 |
-
1) Use `requirements_cpu_only.txt` or `requirements_cpu_only_noavx2.txt` in the command above.
|
136 |
-
|
137 |
-
2) Manually install llama-cpp-python using the appropriate command for your hardware: [Installation from PyPI](https://github.com/abetlen/llama-cpp-python#installation-with-hardware-acceleration).
|
138 |
-
* Use the `LLAMA_HIPBLAS=on` toggle.
|
139 |
-
* Note the [Windows remarks](https://github.com/abetlen/llama-cpp-python#windows-remarks).
|
140 |
-
|
141 |
-
3) Manually install AutoGPTQ: [Installation](https://github.com/PanQiWei/AutoGPTQ#install-from-source).
|
142 |
-
* Perform the from-source installation - there are no prebuilt ROCm packages for Windows.
|
143 |
-
|
144 |
-
##### Older NVIDIA GPUs
|
145 |
-
|
146 |
-
1) For Kepler GPUs and older, you will need to install CUDA 11.8 instead of 12:
|
147 |
-
|
148 |
-
```
|
149 |
-
pip3 install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/cu118
|
150 |
-
conda install -y -c "nvidia/label/cuda-11.8.0" cuda-runtime
|
151 |
-
```
|
152 |
-
|
153 |
-
2) bitsandbytes >= 0.39 may not work. In that case, to use `--load-in-8bit`, you may have to downgrade like this:
|
154 |
-
* Linux: `pip install bitsandbytes==0.38.1`
|
155 |
-
* Windows: `pip install https://github.com/jllllll/bitsandbytes-windows-webui/raw/main/bitsandbytes-0.38.1-py3-none-any.whl`
|
156 |
-
|
157 |
-
##### Manual install
|
158 |
-
|
159 |
-
The `requirements*.txt` above contain various wheels precompiled through GitHub Actions. If you wish to compile things manually, or if you need to because no suitable wheels are available for your hardware, you can use `requirements_nowheels.txt` and then install your desired loaders manually.
|
160 |
-
|
161 |
-
### Alternative: Docker
|
162 |
-
|
163 |
-
```
|
164 |
-
For NVIDIA GPU:
|
165 |
-
ln -s docker/{nvidia/Dockerfile,nvidia/docker-compose.yml,.dockerignore} .
|
166 |
-
For AMD GPU:
|
167 |
-
ln -s docker/{amd/Dockerfile,intel/docker-compose.yml,.dockerignore} .
|
168 |
-
For Intel GPU:
|
169 |
-
ln -s docker/{intel/Dockerfile,amd/docker-compose.yml,.dockerignore} .
|
170 |
-
For CPU only
|
171 |
-
ln -s docker/{cpu/Dockerfile,cpu/docker-compose.yml,.dockerignore} .
|
172 |
-
cp docker/.env.example .env
|
173 |
-
#Create logs/cache dir :
|
174 |
-
mkdir -p logs cache
|
175 |
-
# Edit .env and set:
|
176 |
-
# TORCH_CUDA_ARCH_LIST based on your GPU model
|
177 |
-
# APP_RUNTIME_GID your host user's group id (run `id -g` in a terminal)
|
178 |
-
# BUILD_EXTENIONS optionally add comma separated list of extensions to build
|
179 |
-
# Edit CMD_FLAGS.txt and add in it the options you want to execute (like --listen --cpu)
|
180 |
-
#
|
181 |
-
docker compose up --build
|
182 |
-
```
|
183 |
-
|
184 |
-
* You need to have Docker Compose v2.17 or higher installed. See [this guide](https://github.com/oobabooga/text-generation-webui/wiki/09-%E2%80%90-Docker) for instructions.
|
185 |
-
* For additional docker files, check out [this repository](https://github.com/Atinoda/text-generation-webui-docker).
|
186 |
-
|
187 |
-
### Updating the requirements
|
188 |
-
|
189 |
-
From time to time, the `requirements*.txt` change. To update, use these commands:
|
190 |
-
|
191 |
-
```
|
192 |
-
conda activate textgen
|
193 |
-
cd text-generation-webui
|
194 |
-
pip install -r <requirements file that you have used> --upgrade
|
195 |
-
```
|
196 |
-
</details>
|
197 |
-
|
198 |
-
<details>
|
199 |
-
<summary>
|
200 |
-
List of command-line flags
|
201 |
-
</summary>
|
202 |
-
|
203 |
-
#### Basic settings
|
204 |
-
|
205 |
-
| Flag | Description |
|
206 |
-
|--------------------------------------------|-------------|
|
207 |
-
| `-h`, `--help` | show this help message and exit |
|
208 |
-
| `--multi-user` | Multi-user mode. Chat histories are not saved or automatically loaded. WARNING: this is likely not safe for sharing publicly. |
|
209 |
-
| `--character CHARACTER` | The name of the character to load in chat mode by default. |
|
210 |
-
| `--model MODEL` | Name of the model to load by default. |
|
211 |
-
| `--lora LORA [LORA ...]` | The list of LoRAs to load. If you want to load more than one LoRA, write the names separated by spaces. |
|
212 |
-
| `--model-dir MODEL_DIR` | Path to directory with all the models. |
|
213 |
-
| `--lora-dir LORA_DIR` | Path to directory with all the loras. |
|
214 |
-
| `--model-menu` | Show a model menu in the terminal when the web UI is first launched. |
|
215 |
-
| `--settings SETTINGS_FILE` | Load the default interface settings from this yaml file. See `settings-template.yaml` for an example. If you create a file called `settings.yaml`, this file will be loaded by default without the need to use the `--settings` flag. |
|
216 |
-
| `--extensions EXTENSIONS [EXTENSIONS ...]` | The list of extensions to load. If you want to load more than one extension, write the names separated by spaces. |
|
217 |
-
| `--verbose` | Print the prompts to the terminal. |
|
218 |
-
| `--chat-buttons` | Show buttons on the chat tab instead of a hover menu. |
|
219 |
-
|
220 |
-
#### Model loader
|
221 |
-
|
222 |
-
| Flag | Description |
|
223 |
-
|--------------------------------------------|-------------|
|
224 |
-
| `--loader LOADER` | Choose the model loader manually, otherwise, it will get autodetected. Valid options: Transformers, llama.cpp, llamacpp_HF, ExLlamav2_HF, ExLlamav2, AutoGPTQ, AutoAWQ, GPTQ-for-LLaMa, ctransformers, QuIP#. |
|
225 |
-
|
226 |
-
#### Accelerate/transformers
|
227 |
-
|
228 |
-
| Flag | Description |
|
229 |
-
|---------------------------------------------|-------------|
|
230 |
-
| `--cpu` | Use the CPU to generate text. Warning: Training on CPU is extremely slow. |
|
231 |
-
| `--auto-devices` | Automatically split the model across the available GPU(s) and CPU. |
|
232 |
-
| `--gpu-memory GPU_MEMORY [GPU_MEMORY ...]` | Maximum GPU memory in GiB to be allocated per GPU. Example: --gpu-memory 10 for a single GPU, --gpu-memory 10 5 for two GPUs. You can also set values in MiB like --gpu-memory 3500MiB. |
|
233 |
-
| `--cpu-memory CPU_MEMORY` | Maximum CPU memory in GiB to allocate for offloaded weights. Same as above. |
|
234 |
-
| `--disk` | If the model is too large for your GPU(s) and CPU combined, send the remaining layers to the disk. |
|
235 |
-
| `--disk-cache-dir DISK_CACHE_DIR` | Directory to save the disk cache to. Defaults to "cache". |
|
236 |
-
| `--load-in-8bit` | Load the model with 8-bit precision (using bitsandbytes). |
|
237 |
-
| `--bf16` | Load the model with bfloat16 precision. Requires NVIDIA Ampere GPU. |
|
238 |
-
| `--no-cache` | Set `use_cache` to `False` while generating text. This reduces VRAM usage slightly, but it comes at a performance cost. |
|
239 |
-
| `--trust-remote-code` | Set `trust_remote_code=True` while loading the model. Necessary for some models. |
|
240 |
-
| `--no_use_fast` | Set use_fast=False while loading the tokenizer (it's True by default). Use this if you have any problems related to use_fast. |
|
241 |
-
| `--use_flash_attention_2` | Set use_flash_attention_2=True while loading the model. |
|
242 |
-
|
243 |
-
#### bitsandbytes 4-bit
|
244 |
-
|
245 |
-
⚠️ Requires minimum compute of 7.0 on Windows at the moment.
|
246 |
-
|
247 |
-
| Flag | Description |
|
248 |
-
|---------------------------------------------|-------------|
|
249 |
-
| `--load-in-4bit` | Load the model with 4-bit precision (using bitsandbytes). |
|
250 |
-
| `--use_double_quant` | use_double_quant for 4-bit. |
|
251 |
-
| `--compute_dtype COMPUTE_DTYPE` | compute dtype for 4-bit. Valid options: bfloat16, float16, float32. |
|
252 |
-
| `--quant_type QUANT_TYPE` | quant_type for 4-bit. Valid options: nf4, fp4. |
|
253 |
-
|
254 |
-
#### llama.cpp
|
255 |
-
|
256 |
-
| Flag | Description |
|
257 |
-
|-------------|-------------|
|
258 |
-
| `--tensorcores` | Use llama-cpp-python compiled with tensor cores support. This increases performance on RTX cards. NVIDIA only. |
|
259 |
-
| `--n_ctx N_CTX` | Size of the prompt context. |
|
260 |
-
| `--threads` | Number of threads to use. |
|
261 |
-
| `--threads-batch THREADS_BATCH` | Number of threads to use for batches/prompt processing. |
|
262 |
-
| `--no_mul_mat_q` | Disable the mulmat kernels. |
|
263 |
-
| `--n_batch` | Maximum number of prompt tokens to batch together when calling llama_eval. |
|
264 |
-
| `--no-mmap` | Prevent mmap from being used. |
|
265 |
-
| `--mlock` | Force the system to keep the model in RAM. |
|
266 |
-
| `--n-gpu-layers N_GPU_LAYERS` | Number of layers to offload to the GPU. |
|
267 |
-
| `--tensor_split TENSOR_SPLIT` | Split the model across multiple GPUs. Comma-separated list of proportions. Example: 18,17. |
|
268 |
-
| `--numa` | Activate NUMA task allocation for llama.cpp. |
|
269 |
-
| `--logits_all`| Needs to be set for perplexity evaluation to work. Otherwise, ignore it, as it makes prompt processing slower. |
|
270 |
-
| `--no_offload_kqv` | Do not offload the K, Q, V to the GPU. This saves VRAM but reduces the performance. |
|
271 |
-
| `--cache-capacity CACHE_CAPACITY` | Maximum cache capacity (llama-cpp-python). Examples: 2000MiB, 2GiB. When provided without units, bytes will be assumed. |
|
272 |
-
| `--row_split` | Split the model by rows across GPUs. This may improve multi-gpu performance. |
|
273 |
-
| `--streaming-llm` | Activate StreamingLLM to avoid re-evaluating the entire prompt when old messages are removed. |
|
274 |
-
| `--attention-sink-size ATTENTION_SINK_SIZE` | StreamingLLM: number of sink tokens. Only used if the trimmed prompt doesn't share a prefix with the old prompt. |
|
275 |
-
|
276 |
-
#### ExLlamav2
|
277 |
-
|
278 |
-
| Flag | Description |
|
279 |
-
|------------------|-------------|
|
280 |
-
|`--gpu-split` | Comma-separated list of VRAM (in GB) to use per GPU device for model layers. Example: 20,7,7. |
|
281 |
-
|`--max_seq_len MAX_SEQ_LEN` | Maximum sequence length. |
|
282 |
-
|`--cfg-cache` | ExLlamav2_HF: Create an additional cache for CFG negative prompts. Necessary to use CFG with that loader. |
|
283 |
-
|`--no_flash_attn` | Force flash-attention to not be used. |
|
284 |
-
|`--cache_8bit` | Use 8-bit cache to save VRAM. |
|
285 |
-
|`--cache_4bit` | Use Q4 cache to save VRAM. |
|
286 |
-
|`--num_experts_per_token NUM_EXPERTS_PER_TOKEN` | Number of experts to use for generation. Applies to MoE models like Mixtral. |
|
287 |
-
|
288 |
-
#### AutoGPTQ
|
289 |
-
|
290 |
-
| Flag | Description |
|
291 |
-
|------------------|-------------|
|
292 |
-
| `--triton` | Use triton. |
|
293 |
-
| `--no_inject_fused_attention` | Disable the use of fused attention, which will use less VRAM at the cost of slower inference. |
|
294 |
-
| `--no_inject_fused_mlp` | Triton mode only: disable the use of fused MLP, which will use less VRAM at the cost of slower inference. |
|
295 |
-
| `--no_use_cuda_fp16` | This can make models faster on some systems. |
|
296 |
-
| `--desc_act` | For models that don't have a quantize_config.json, this parameter is used to define whether to set desc_act or not in BaseQuantizeConfig. |
|
297 |
-
| `--disable_exllama` | Disable ExLlama kernel, which can improve inference speed on some systems. |
|
298 |
-
| `--disable_exllamav2` | Disable ExLlamav2 kernel. |
|
299 |
-
|
300 |
-
#### GPTQ-for-LLaMa
|
301 |
-
|
302 |
-
| Flag | Description |
|
303 |
-
|---------------------------|-------------|
|
304 |
-
| `--wbits WBITS` | Load a pre-quantized model with specified precision in bits. 2, 3, 4 and 8 are supported. |
|
305 |
-
| `--model_type MODEL_TYPE` | Model type of pre-quantized model. Currently LLaMA, OPT, and GPT-J are supported. |
|
306 |
-
| `--groupsize GROUPSIZE` | Group size. |
|
307 |
-
| `--pre_layer PRE_LAYER [PRE_LAYER ...]` | The number of layers to allocate to the GPU. Setting this parameter enables CPU offloading for 4-bit models. For multi-gpu, write the numbers separated by spaces, eg `--pre_layer 30 60`. |
|
308 |
-
| `--checkpoint CHECKPOINT` | The path to the quantized checkpoint file. If not specified, it will be automatically detected. |
|
309 |
-
| `--monkey-patch` | Apply the monkey patch for using LoRAs with quantized models. |
|
310 |
-
|
311 |
-
#### ctransformers
|
312 |
-
|
313 |
-
| Flag | Description |
|
314 |
-
|-------------|-------------|
|
315 |
-
| `--model_type MODEL_TYPE` | Model type of pre-quantized model. Currently gpt2, gptj, gptneox, falcon, llama, mpt, starcoder (gptbigcode), dollyv2, and replit are supported. |
|
316 |
-
|
317 |
-
#### HQQ
|
318 |
-
|
319 |
-
| Flag | Description |
|
320 |
-
|-------------|-------------|
|
321 |
-
| `--hqq-backend` | Backend for the HQQ loader. Valid options: PYTORCH, PYTORCH_COMPILE, ATEN. |
|
322 |
-
|
323 |
-
#### DeepSpeed
|
324 |
-
|
325 |
-
| Flag | Description |
|
326 |
-
|---------------------------------------|-------------|
|
327 |
-
| `--deepspeed` | Enable the use of DeepSpeed ZeRO-3 for inference via the Transformers integration. |
|
328 |
-
| `--nvme-offload-dir NVME_OFFLOAD_DIR` | DeepSpeed: Directory to use for ZeRO-3 NVME offloading. |
|
329 |
-
| `--local_rank LOCAL_RANK` | DeepSpeed: Optional argument for distributed setups. |
|
330 |
-
|
331 |
-
#### RoPE (for llama.cpp, ExLlamaV2, and transformers)
|
332 |
-
|
333 |
-
| Flag | Description |
|
334 |
-
|------------------|-------------|
|
335 |
-
| `--alpha_value ALPHA_VALUE` | Positional embeddings alpha factor for NTK RoPE scaling. Use either this or `compress_pos_emb`, not both. |
|
336 |
-
| `--rope_freq_base ROPE_FREQ_BASE` | If greater than 0, will be used instead of alpha_value. Those two are related by `rope_freq_base = 10000 * alpha_value ^ (64 / 63)`. |
|
337 |
-
| `--compress_pos_emb COMPRESS_POS_EMB` | Positional embeddings compression factor. Should be set to `(context length) / (model's original context length)`. Equal to `1/rope_freq_scale`. |
|
338 |
-
|
339 |
-
#### Gradio
|
340 |
-
|
341 |
-
| Flag | Description |
|
342 |
-
|---------------------------------------|-------------|
|
343 |
-
| `--listen` | Make the web UI reachable from your local network. |
|
344 |
-
| `--listen-port LISTEN_PORT` | The listening port that the server will use. |
|
345 |
-
| `--listen-host LISTEN_HOST` | The hostname that the server will use. |
|
346 |
-
| `--share` | Create a public URL. This is useful for running the web UI on Google Colab or similar. |
|
347 |
-
| `--auto-launch` | Open the web UI in the default browser upon launch. |
|
348 |
-
| `--gradio-auth USER:PWD` | Set Gradio authentication password in the format "username:password". Multiple credentials can also be supplied with "u1:p1,u2:p2,u3:p3". |
|
349 |
-
| `--gradio-auth-path GRADIO_AUTH_PATH` | Set the Gradio authentication file path. The file should contain one or more user:password pairs in the same format as above. |
|
350 |
-
| `--ssl-keyfile SSL_KEYFILE` | The path to the SSL certificate key file. |
|
351 |
-
| `--ssl-certfile SSL_CERTFILE` | The path to the SSL certificate cert file. |
|
352 |
-
|
353 |
-
#### API
|
354 |
-
|
355 |
-
| Flag | Description |
|
356 |
-
|---------------------------------------|-------------|
|
357 |
-
| `--api` | Enable the API extension. |
|
358 |
-
| `--public-api` | Create a public URL for the API using Cloudfare. |
|
359 |
-
| `--public-api-id PUBLIC_API_ID` | Tunnel ID for named Cloudflare Tunnel. Use together with public-api option. |
|
360 |
-
| `--api-port API_PORT` | The listening port for the API. |
|
361 |
-
| `--api-key API_KEY` | API authentication key. |
|
362 |
-
| `--admin-key ADMIN_KEY` | API authentication key for admin tasks like loading and unloading models. If not set, will be the same as --api-key. |
|
363 |
-
| `--nowebui` | Do not launch the Gradio UI. Useful for launching the API in standalone mode. |
|
364 |
-
|
365 |
-
#### Multimodal
|
366 |
-
|
367 |
-
| Flag | Description |
|
368 |
-
|---------------------------------------|-------------|
|
369 |
-
| `--multimodal-pipeline PIPELINE` | The multimodal pipeline to use. Examples: `llava-7b`, `llava-13b`. |
|
370 |
-
|
371 |
-
</details>
|
372 |
-
|
373 |
-
## Documentation
|
374 |
-
|
375 |
-
https://github.com/oobabooga/text-generation-webui/wiki
|
376 |
-
|
377 |
-
## Downloading models
|
378 |
-
|
379 |
-
Models should be placed in the folder `text-generation-webui/models`. They are usually downloaded from [Hugging Face](https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads).
|
380 |
-
|
381 |
-
* GGUF models are a single file and should be placed directly into `models`. Example:
|
382 |
-
|
383 |
-
```
|
384 |
-
text-generation-webui
|
385 |
-
└── models
|
386 |
-
└── llama-2-13b-chat.Q4_K_M.gguf
|
387 |
-
```
|
388 |
-
|
389 |
-
* The remaining model types (like 16-bit transformers models and GPTQ models) are made of several files and must be placed in a subfolder. Example:
|
390 |
-
|
391 |
-
```
|
392 |
-
text-generation-webui
|
393 |
-
├── models
|
394 |
-
│ ├── lmsys_vicuna-33b-v1.3
|
395 |
-
│ │ ├── config.json
|
396 |
-
│ │ ├── generation_config.json
|
397 |
-
│ │ ├── pytorch_model-00001-of-00007.bin
|
398 |
-
│ │ ├── pytorch_model-00002-of-00007.bin
|
399 |
-
│ │ ├── pytorch_model-00003-of-00007.bin
|
400 |
-
│ │ ├── pytorch_model-00004-of-00007.bin
|
401 |
-
│ │ ├── pytorch_model-00005-of-00007.bin
|
402 |
-
│ │ ├── pytorch_model-00006-of-00007.bin
|
403 |
-
│ │ ├── pytorch_model-00007-of-00007.bin
|
404 |
-
│ │ ├── pytorch_model.bin.index.json
|
405 |
-
│ │ ├── special_tokens_map.json
|
406 |
-
│ │ ├── tokenizer_config.json
|
407 |
-
│ │ └── tokenizer.model
|
408 |
-
```
|
409 |
-
|
410 |
-
In both cases, you can use the "Model" tab of the UI to download the model from Hugging Face automatically. It is also possible to download it via the command-line with
|
411 |
-
|
412 |
-
```
|
413 |
-
python download-model.py organization/model
|
414 |
-
```
|
415 |
-
|
416 |
-
Run `python download-model.py --help` to see all the options.
|
417 |
-
|
418 |
-
## Google Colab notebook
|
419 |
-
|
420 |
-
https://colab.research.google.com/github/oobabooga/text-generation-webui/blob/main/Colab-TextGen-GPU.ipynb
|
421 |
-
|
422 |
-
## Contributing
|
423 |
-
|
424 |
-
If you would like to contribute to the project, check out the [Contributing guidelines](https://github.com/oobabooga/text-generation-webui/wiki/Contributing-guidelines).
|
425 |
-
|
426 |
-
## Community
|
427 |
-
|
428 |
-
* Subreddit: https://www.reddit.com/r/oobabooga/
|
429 |
-
* Discord: https://discord.gg/jwZCF2dPQN
|
430 |
-
|
431 |
-
## Acknowledgment
|
432 |
-
|
433 |
-
In August 2023, [Andreessen Horowitz](https://a16z.com/) (a16z) provided a generous grant to encourage and support my independent work on this project. I am **extremely** grateful for their trust and recognition.
|
|
|
1 |
+
---
|
2 |
+
title: NETO AI
|
3 |
+
sdk: gradio
|
4 |
+
emoji: 📚
|
5 |
+
colorFrom: gray
|
6 |
+
colorTo: gray
|
7 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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