NahFam13 commited on
Commit
76a12b2
1 Parent(s): d26280a
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. Colab-TextGen-GPU.ipynb +130 -0
  2. README.md +428 -11
  3. compose-dev.yaml +12 -0
  4. css/NotoSans/NotoSans-Black.woff +0 -0
  5. css/NotoSans/NotoSans-Black.woff2 +0 -0
  6. css/NotoSans/NotoSans-BlackItalic.woff +0 -0
  7. css/NotoSans/NotoSans-BlackItalic.woff2 +0 -0
  8. css/NotoSans/NotoSans-Bold.woff +0 -0
  9. css/NotoSans/NotoSans-Bold.woff2 +0 -0
  10. css/NotoSans/NotoSans-BoldItalic.woff +0 -0
  11. css/NotoSans/NotoSans-BoldItalic.woff2 +0 -0
  12. css/NotoSans/NotoSans-ExtraBold.woff +0 -0
  13. css/NotoSans/NotoSans-ExtraBold.woff2 +0 -0
  14. css/NotoSans/NotoSans-ExtraBoldItalic.woff +0 -0
  15. css/NotoSans/NotoSans-ExtraBoldItalic.woff2 +0 -0
  16. css/NotoSans/NotoSans-ExtraLight.woff +0 -0
  17. css/NotoSans/NotoSans-ExtraLight.woff2 +0 -0
  18. css/NotoSans/NotoSans-ExtraLightItalic.woff +0 -0
  19. css/NotoSans/NotoSans-ExtraLightItalic.woff2 +0 -0
  20. css/NotoSans/NotoSans-Italic.woff +0 -0
  21. css/NotoSans/NotoSans-Italic.woff2 +0 -0
  22. css/NotoSans/NotoSans-Light.woff +0 -0
  23. css/NotoSans/NotoSans-Light.woff2 +0 -0
  24. css/NotoSans/NotoSans-LightItalic.woff +0 -0
  25. css/NotoSans/NotoSans-LightItalic.woff2 +0 -0
  26. css/NotoSans/NotoSans-Medium.woff +0 -0
  27. css/NotoSans/NotoSans-Medium.woff2 +0 -0
  28. css/NotoSans/NotoSans-MediumItalic.woff +0 -0
  29. css/NotoSans/NotoSans-MediumItalic.woff2 +0 -0
  30. css/NotoSans/NotoSans-Regular.woff +0 -0
  31. css/NotoSans/NotoSans-Regular.woff2 +0 -0
  32. css/NotoSans/NotoSans-SemiBold.woff +0 -0
  33. css/NotoSans/NotoSans-SemiBold.woff2 +0 -0
  34. css/NotoSans/NotoSans-SemiBoldItalic.woff +0 -0
  35. css/NotoSans/NotoSans-SemiBoldItalic.woff2 +0 -0
  36. css/NotoSans/NotoSans-Thin.woff +0 -0
  37. css/NotoSans/NotoSans-Thin.woff2 +0 -0
  38. css/NotoSans/NotoSans-ThinItalic.woff +0 -0
  39. css/NotoSans/NotoSans-ThinItalic.woff2 +0 -0
  40. css/NotoSans/stylesheet.css +166 -0
  41. css/chat_style-TheEncrypted777.css +133 -0
  42. css/chat_style-cai-chat-square.css +21 -0
  43. css/chat_style-cai-chat.css +62 -0
  44. css/chat_style-messenger.css +99 -0
  45. css/chat_style-wpp.css +55 -0
  46. css/html_4chan_style.css +73 -0
  47. css/html_instruct_style.css +82 -0
  48. css/html_readable_style.css +33 -0
  49. css/main.css +702 -0
  50. docker/.dockerignore +8 -0
Colab-TextGen-GPU.ipynb ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "private_outputs": true,
7
+ "provenance": [],
8
+ "gpuType": "T4"
9
+ },
10
+ "kernelspec": {
11
+ "name": "python3",
12
+ "display_name": "Python 3"
13
+ },
14
+ "language_info": {
15
+ "name": "python"
16
+ },
17
+ "accelerator": "GPU"
18
+ },
19
+ "cells": [
20
+ {
21
+ "cell_type": "markdown",
22
+ "source": [
23
+ "# oobabooga/text-generation-webui\n",
24
+ "\n",
25
+ "After running both cells, a public gradio URL will appear at the bottom in a few minutes. You can optionally generate an API link.\n",
26
+ "\n",
27
+ "* Project page: https://github.com/oobabooga/text-generation-webui\n",
28
+ "* Gradio server status: https://status.gradio.app/"
29
+ ],
30
+ "metadata": {
31
+ "id": "MFQl6-FjSYtY"
32
+ }
33
+ },
34
+ {
35
+ "cell_type": "code",
36
+ "source": [
37
+ "#@title 1. Keep this tab alive to prevent Colab from disconnecting you { display-mode: \"form\" }\n",
38
+ "\n",
39
+ "#@markdown Press play on the music player that will appear below:\n",
40
+ "%%html\n",
41
+ "<audio src=\"https://oobabooga.github.io/silence.m4a\" controls>"
42
+ ],
43
+ "metadata": {
44
+ "id": "f7TVVj_z4flw"
45
+ },
46
+ "execution_count": null,
47
+ "outputs": []
48
+ },
49
+ {
50
+ "cell_type": "code",
51
+ "source": [
52
+ "#@title 2. Launch the web UI\n",
53
+ "\n",
54
+ "#@markdown If unsure about the branch, write \"main\" or leave it blank.\n",
55
+ "\n",
56
+ "import torch\n",
57
+ "from pathlib import Path\n",
58
+ "\n",
59
+ "if Path.cwd().name != 'text-generation-webui':\n",
60
+ " print(\"Installing the webui...\")\n",
61
+ "\n",
62
+ " !git clone https://github.com/oobabooga/text-generation-webui\n",
63
+ " %cd text-generation-webui\n",
64
+ "\n",
65
+ " torver = torch.__version__\n",
66
+ " print(f\"TORCH: {torver}\")\n",
67
+ " is_cuda118 = '+cu118' in torver # 2.1.0+cu118\n",
68
+ "\n",
69
+ " textgen_requirements = open('requirements.txt').read().splitlines()\n",
70
+ " if is_cuda118:\n",
71
+ " textgen_requirements = [req.replace('+cu121', '+cu118').replace('+cu122', '+cu118') for req in textgen_requirements]\n",
72
+ " with open('temp_requirements.txt', 'w') as file:\n",
73
+ " file.write('\\n'.join(textgen_requirements))\n",
74
+ "\n",
75
+ " !pip install -r extensions/openai/requirements.txt --upgrade\n",
76
+ " !pip install -r temp_requirements.txt --upgrade\n",
77
+ "\n",
78
+ " print(\"\\033[1;32;1m\\n --> If you see a warning about \\\"previously imported packages\\\", just ignore it.\\033[0;37;0m\")\n",
79
+ " print(\"\\033[1;32;1m\\n --> There is no need to restart the runtime.\\n\\033[0;37;0m\")\n",
80
+ "\n",
81
+ " try:\n",
82
+ " import flash_attn\n",
83
+ " except:\n",
84
+ " !pip uninstall -y flash_attn\n",
85
+ "\n",
86
+ "# Parameters\n",
87
+ "model_url = \"https://huggingface.co/TheBloke/MythoMax-L2-13B-GPTQ\" #@param {type:\"string\"}\n",
88
+ "branch = \"gptq-4bit-32g-actorder_True\" #@param {type:\"string\"}\n",
89
+ "command_line_flags = \"--n-gpu-layers 128 --load-in-4bit --use_double_quant\" #@param {type:\"string\"}\n",
90
+ "api = False #@param {type:\"boolean\"}\n",
91
+ "\n",
92
+ "if api:\n",
93
+ " for param in ['--api', '--public-api']:\n",
94
+ " if param not in command_line_flags:\n",
95
+ " command_line_flags += f\" {param}\"\n",
96
+ "\n",
97
+ "model_url = model_url.strip()\n",
98
+ "if model_url != \"\":\n",
99
+ " if not model_url.startswith('http'):\n",
100
+ " model_url = 'https://huggingface.co/' + model_url\n",
101
+ "\n",
102
+ " # Download the model\n",
103
+ " url_parts = model_url.strip('/').strip().split('/')\n",
104
+ " output_folder = f\"{url_parts[-2]}_{url_parts[-1]}\"\n",
105
+ " branch = branch.strip('\"\\' ')\n",
106
+ " if branch.strip() not in ['', 'main']:\n",
107
+ " output_folder += f\"_{branch}\"\n",
108
+ " !python download-model.py {model_url} --branch {branch}\n",
109
+ " else:\n",
110
+ " !python download-model.py {model_url}\n",
111
+ "else:\n",
112
+ " output_folder = \"\"\n",
113
+ "\n",
114
+ "# Start the web UI\n",
115
+ "cmd = f\"python server.py --share\"\n",
116
+ "if output_folder != \"\":\n",
117
+ " cmd += f\" --model {output_folder}\"\n",
118
+ "cmd += f\" {command_line_flags}\"\n",
119
+ "print(cmd)\n",
120
+ "!$cmd"
121
+ ],
122
+ "metadata": {
123
+ "id": "LGQ8BiMuXMDG",
124
+ "cellView": "form"
125
+ },
126
+ "execution_count": null,
127
+ "outputs": []
128
+ }
129
+ ]
130
+ }
README.md CHANGED
@@ -1,11 +1,428 @@
1
- ---
2
- title: Webbyuu
3
- emoji: 👀
4
- colorFrom: green
5
- colorTo: yellow
6
- sdk: docker
7
- pinned: false
8
- license: other
9
- ---
10
-
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Text generation web UI
2
+
3
+ A Gradio web UI for Large Language Models.
4
+
5
+ Its goal is to become the [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) of text generation.
6
+
7
+ |![Image1](https://github.com/oobabooga/screenshots/raw/main/print_instruct.png) | ![Image2](https://github.com/oobabooga/screenshots/raw/main/print_chat.png) |
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_linux.sh`, `update_windows.bat`, `update_macos.sh`, or `update_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_`, or `cmd_`) as admin/root.
49
+ * For additional instructions about AMD and WSL setup, consult [the documentation](https://github.com/oobabooga/text-generation-webui/wiki).
50
+ * 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=FALSE ./start_linux.sh`.
51
+
52
+ ### Manual installation using Conda
53
+
54
+ Recommended if you have some experience with the command-line.
55
+
56
+ #### 0. Install Conda
57
+
58
+ https://docs.conda.io/en/latest/miniconda.html
59
+
60
+ On Linux or WSL, it can be automatically installed with these two commands ([source](https://educe-ubc.github.io/conda.html)):
61
+
62
+ ```
63
+ curl -sL "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" > "Miniconda3.sh"
64
+ bash Miniconda3.sh
65
+ ```
66
+
67
+ #### 1. Create a new conda environment
68
+
69
+ ```
70
+ conda create -n textgen python=3.11
71
+ conda activate textgen
72
+ ```
73
+
74
+ #### 2. Install Pytorch
75
+
76
+ | System | GPU | Command |
77
+ |--------|---------|---------|
78
+ | Linux/WSL | NVIDIA | `pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121` |
79
+ | Linux/WSL | CPU only | `pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu` |
80
+ | Linux | AMD | `pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.6` |
81
+ | MacOS + MPS | Any | `pip3 install torch torchvision torchaudio` |
82
+ | Windows | NVIDIA | `pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121` |
83
+ | Windows | CPU only | `pip3 install torch torchvision torchaudio` |
84
+
85
+ The up-to-date commands can be found here: https://pytorch.org/get-started/locally/.
86
+
87
+ For NVIDIA, you also need to install the CUDA runtime libraries:
88
+
89
+ ```
90
+ conda install -y -c "nvidia/label/cuda-12.1.1" cuda-runtime
91
+ ```
92
+
93
+ If you need `nvcc` to compile some library manually, replace the command above with
94
+
95
+ ```
96
+ conda install -y -c "nvidia/label/cuda-12.1.1" cuda
97
+ ```
98
+
99
+ #### 3. Install the web UI
100
+
101
+ ```
102
+ git clone https://github.com/oobabooga/text-generation-webui
103
+ cd text-generation-webui
104
+ pip install -r <requirements file according to table below>
105
+ ```
106
+
107
+ Requirements file to use:
108
+
109
+ | GPU | CPU | requirements file to use |
110
+ |--------|---------|---------|
111
+ | NVIDIA | has AVX2 | `requirements.txt` |
112
+ | NVIDIA | no AVX2 | `requirements_noavx2.txt` |
113
+ | AMD | has AVX2 | `requirements_amd.txt` |
114
+ | AMD | no AVX2 | `requirements_amd_noavx2.txt` |
115
+ | CPU only | has AVX2 | `requirements_cpu_only.txt` |
116
+ | CPU only | no AVX2 | `requirements_cpu_only_noavx2.txt` |
117
+ | Apple | Intel | `requirements_apple_intel.txt` |
118
+ | Apple | Apple Silicon | `requirements_apple_silicon.txt` |
119
+
120
+ ### Start the web UI
121
+
122
+ ```
123
+ conda activate textgen
124
+ cd text-generation-webui
125
+ python server.py
126
+ ```
127
+
128
+ Then browse to
129
+
130
+ `http://localhost:7860/?__theme=dark`
131
+
132
+ ##### AMD GPU on Windows
133
+
134
+ 1) Use `requirements_cpu_only.txt` or `requirements_cpu_only_noavx2.txt` in the command above.
135
+
136
+ 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).
137
+ * Use the `LLAMA_HIPBLAS=on` toggle.
138
+ * Note the [Windows remarks](https://github.com/abetlen/llama-cpp-python#windows-remarks).
139
+
140
+ 3) Manually install AutoGPTQ: [Installation](https://github.com/PanQiWei/AutoGPTQ#install-from-source).
141
+ * Perform the from-source installation - there are no prebuilt ROCm packages for Windows.
142
+
143
+ ##### Older NVIDIA GPUs
144
+
145
+ 1) For Kepler GPUs and older, you will need to install CUDA 11.8 instead of 12:
146
+
147
+ ```
148
+ pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
149
+ conda install -y -c "nvidia/label/cuda-11.8.0" cuda-runtime
150
+ ```
151
+
152
+ 2) bitsandbytes >= 0.39 may not work. In that case, to use `--load-in-8bit`, you may have to downgrade like this:
153
+ * Linux: `pip install bitsandbytes==0.38.1`
154
+ * Windows: `pip install https://github.com/jllllll/bitsandbytes-windows-webui/raw/main/bitsandbytes-0.38.1-py3-none-any.whl`
155
+
156
+ ##### Manual install
157
+
158
+ 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.
159
+
160
+ ### Alternative: Docker
161
+
162
+ ```
163
+ For NVIDIA GPU:
164
+ ln -s docker/{nvidia/Dockerfile,nvidia/docker-compose.yml,.dockerignore} .
165
+ For AMD GPU:
166
+ ln -s docker/{amd/Dockerfile,intel/docker-compose.yml,.dockerignore} .
167
+ For Intel GPU:
168
+ ln -s docker/{intel/Dockerfile,amd/docker-compose.yml,.dockerignore} .
169
+ For CPU only
170
+ ln -s docker/{cpu/Dockerfile,cpu/docker-compose.yml,.dockerignore} .
171
+ cp docker/.env.example .env
172
+ #Create logs/cache dir :
173
+ mkdir -p logs cache
174
+ # Edit .env and set:
175
+ # TORCH_CUDA_ARCH_LIST based on your GPU model
176
+ # APP_RUNTIME_GID your host user's group id (run `id -g` in a terminal)
177
+ # BUILD_EXTENIONS optionally add comma separated list of extensions to build
178
+ # Edit CMD_FLAGS.txt and add in it the options you want to execute (like --listen --cpu)
179
+ #
180
+ docker compose up --build
181
+ ```
182
+
183
+ * 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.
184
+ * For additional docker files, check out [this repository](https://github.com/Atinoda/text-generation-webui-docker).
185
+
186
+ ### Updating the requirements
187
+
188
+ From time to time, the `requirements*.txt` change. To update, use these commands:
189
+
190
+ ```
191
+ conda activate textgen
192
+ cd text-generation-webui
193
+ pip install -r <requirements file that you have used> --upgrade
194
+ ```
195
+ </details>
196
+
197
+ <details>
198
+ <summary>
199
+ List of command-line flags
200
+ </summary>
201
+
202
+ #### Basic settings
203
+
204
+ | Flag | Description |
205
+ |--------------------------------------------|-------------|
206
+ | `-h`, `--help` | show this help message and exit |
207
+ | `--multi-user` | Multi-user mode. Chat histories are not saved or automatically loaded. WARNING: this is likely not safe for sharing publicly. |
208
+ | `--character CHARACTER` | The name of the character to load in chat mode by default. |
209
+ | `--model MODEL` | Name of the model to load by default. |
210
+ | `--lora LORA [LORA ...]` | The list of LoRAs to load. If you want to load more than one LoRA, write the names separated by spaces. |
211
+ | `--model-dir MODEL_DIR` | Path to directory with all the models. |
212
+ | `--lora-dir LORA_DIR` | Path to directory with all the loras. |
213
+ | `--model-menu` | Show a model menu in the terminal when the web UI is first launched. |
214
+ | `--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. |
215
+ | `--extensions EXTENSIONS [EXTENSIONS ...]` | The list of extensions to load. If you want to load more than one extension, write the names separated by spaces. |
216
+ | `--verbose` | Print the prompts to the terminal. |
217
+ | `--chat-buttons` | Show buttons on the chat tab instead of a hover menu. |
218
+
219
+ #### Model loader
220
+
221
+ | Flag | Description |
222
+ |--------------------------------------------|-------------|
223
+ | `--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#. |
224
+
225
+ #### Accelerate/transformers
226
+
227
+ | Flag | Description |
228
+ |---------------------------------------------|-------------|
229
+ | `--cpu` | Use the CPU to generate text. Warning: Training on CPU is extremely slow. |
230
+ | `--auto-devices` | Automatically split the model across the available GPU(s) and CPU. |
231
+ | `--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. |
232
+ | `--cpu-memory CPU_MEMORY` | Maximum CPU memory in GiB to allocate for offloaded weights. Same as above. |
233
+ | `--disk` | If the model is too large for your GPU(s) and CPU combined, send the remaining layers to the disk. |
234
+ | `--disk-cache-dir DISK_CACHE_DIR` | Directory to save the disk cache to. Defaults to "cache". |
235
+ | `--load-in-8bit` | Load the model with 8-bit precision (using bitsandbytes). |
236
+ | `--bf16` | Load the model with bfloat16 precision. Requires NVIDIA Ampere GPU. |
237
+ | `--no-cache` | Set `use_cache` to `False` while generating text. This reduces VRAM usage slightly, but it comes at a performance cost. |
238
+ | `--trust-remote-code` | Set `trust_remote_code=True` while loading the model. Necessary for some models. |
239
+ | `--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. |
240
+ | `--use_flash_attention_2` | Set use_flash_attention_2=True while loading the model. |
241
+
242
+ #### bitsandbytes 4-bit
243
+
244
+ ⚠️ Requires minimum compute of 7.0 on Windows at the moment.
245
+
246
+ | Flag | Description |
247
+ |---------------------------------------------|-------------|
248
+ | `--load-in-4bit` | Load the model with 4-bit precision (using bitsandbytes). |
249
+ | `--use_double_quant` | use_double_quant for 4-bit. |
250
+ | `--compute_dtype COMPUTE_DTYPE` | compute dtype for 4-bit. Valid options: bfloat16, float16, float32. |
251
+ | `--quant_type QUANT_TYPE` | quant_type for 4-bit. Valid options: nf4, fp4. |
252
+
253
+ #### llama.cpp
254
+
255
+ | Flag | Description |
256
+ |-------------|-------------|
257
+ | `--tensorcores` | Use llama-cpp-python compiled with tensor cores support. This increases performance on RTX cards. NVIDIA only. |
258
+ | `--n_ctx N_CTX` | Size of the prompt context. |
259
+ | `--threads` | Number of threads to use. |
260
+ | `--threads-batch THREADS_BATCH` | Number of threads to use for batches/prompt processing. |
261
+ | `--no_mul_mat_q` | Disable the mulmat kernels. |
262
+ | `--n_batch` | Maximum number of prompt tokens to batch together when calling llama_eval. |
263
+ | `--no-mmap` | Prevent mmap from being used. |
264
+ | `--mlock` | Force the system to keep the model in RAM. |
265
+ | `--n-gpu-layers N_GPU_LAYERS` | Number of layers to offload to the GPU. |
266
+ | `--tensor_split TENSOR_SPLIT` | Split the model across multiple GPUs. Comma-separated list of proportions. Example: 18,17. |
267
+ | `--numa` | Activate NUMA task allocation for llama.cpp. |
268
+ | `--logits_all`| Needs to be set for perplexity evaluation to work. Otherwise, ignore it, as it makes prompt processing slower. |
269
+ | `--no_offload_kqv` | Do not offload the K, Q, V to the GPU. This saves VRAM but reduces the performance. |
270
+ | `--cache-capacity CACHE_CAPACITY` | Maximum cache capacity (llama-cpp-python). Examples: 2000MiB, 2GiB. When provided without units, bytes will be assumed. |
271
+
272
+ #### ExLlamav2
273
+
274
+ | Flag | Description |
275
+ |------------------|-------------|
276
+ |`--gpu-split` | Comma-separated list of VRAM (in GB) to use per GPU device for model layers. Example: 20,7,7. |
277
+ |`--max_seq_len MAX_SEQ_LEN` | Maximum sequence length. |
278
+ |`--cfg-cache` | ExLlamav2_HF: Create an additional cache for CFG negative prompts. Necessary to use CFG with that loader. |
279
+ |`--no_flash_attn` | Force flash-attention to not be used. |
280
+ |`--cache_8bit` | Use 8-bit cache to save VRAM. |
281
+ |`--num_experts_per_token NUM_EXPERTS_PER_TOKEN` | Number of experts to use for generation. Applies to MoE models like Mixtral. |
282
+
283
+ #### AutoGPTQ
284
+
285
+ | Flag | Description |
286
+ |------------------|-------------|
287
+ | `--triton` | Use triton. |
288
+ | `--no_inject_fused_attention` | Disable the use of fused attention, which will use less VRAM at the cost of slower inference. |
289
+ | `--no_inject_fused_mlp` | Triton mode only: disable the use of fused MLP, which will use less VRAM at the cost of slower inference. |
290
+ | `--no_use_cuda_fp16` | This can make models faster on some systems. |
291
+ | `--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. |
292
+ | `--disable_exllama` | Disable ExLlama kernel, which can improve inference speed on some systems. |
293
+ | `--disable_exllamav2` | Disable ExLlamav2 kernel. |
294
+
295
+ #### GPTQ-for-LLaMa
296
+
297
+ | Flag | Description |
298
+ |---------------------------|-------------|
299
+ | `--wbits WBITS` | Load a pre-quantized model with specified precision in bits. 2, 3, 4 and 8 are supported. |
300
+ | `--model_type MODEL_TYPE` | Model type of pre-quantized model. Currently LLaMA, OPT, and GPT-J are supported. |
301
+ | `--groupsize GROUPSIZE` | Group size. |
302
+ | `--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`. |
303
+ | `--checkpoint CHECKPOINT` | The path to the quantized checkpoint file. If not specified, it will be automatically detected. |
304
+ | `--monkey-patch` | Apply the monkey patch for using LoRAs with quantized models. |
305
+
306
+ #### ctransformers
307
+
308
+ | Flag | Description |
309
+ |-------------|-------------|
310
+ | `--model_type MODEL_TYPE` | Model type of pre-quantized model. Currently gpt2, gptj, gptneox, falcon, llama, mpt, starcoder (gptbigcode), dollyv2, and replit are supported. |
311
+
312
+ #### HQQ
313
+
314
+ | Flag | Description |
315
+ |-------------|-------------|
316
+ | `--hqq-backend` | Backend for the HQQ loader. Valid options: PYTORCH, PYTORCH_COMPILE, ATEN. |
317
+
318
+ #### DeepSpeed
319
+
320
+ | Flag | Description |
321
+ |---------------------------------------|-------------|
322
+ | `--deepspeed` | Enable the use of DeepSpeed ZeRO-3 for inference via the Transformers integration. |
323
+ | `--nvme-offload-dir NVME_OFFLOAD_DIR` | DeepSpeed: Directory to use for ZeRO-3 NVME offloading. |
324
+ | `--local_rank LOCAL_RANK` | DeepSpeed: Optional argument for distributed setups. |
325
+
326
+ #### RoPE (for llama.cpp, ExLlamaV2, and transformers)
327
+
328
+ | Flag | Description |
329
+ |------------------|-------------|
330
+ | `--alpha_value ALPHA_VALUE` | Positional embeddings alpha factor for NTK RoPE scaling. Use either this or `compress_pos_emb`, not both. |
331
+ | `--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)`. |
332
+ | `--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`. |
333
+
334
+ #### Gradio
335
+
336
+ | Flag | Description |
337
+ |---------------------------------------|-------------|
338
+ | `--listen` | Make the web UI reachable from your local network. |
339
+ | `--listen-port LISTEN_PORT` | The listening port that the server will use. |
340
+ | `--listen-host LISTEN_HOST` | The hostname that the server will use. |
341
+ | `--share` | Create a public URL. This is useful for running the web UI on Google Colab or similar. |
342
+ | `--auto-launch` | Open the web UI in the default browser upon launch. |
343
+ | `--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". |
344
+ | `--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. |
345
+ | `--ssl-keyfile SSL_KEYFILE` | The path to the SSL certificate key file. |
346
+ | `--ssl-certfile SSL_CERTFILE` | The path to the SSL certificate cert file. |
347
+
348
+ #### API
349
+
350
+ | Flag | Description |
351
+ |---------------------------------------|-------------|
352
+ | `--api` | Enable the API extension. |
353
+ | `--public-api` | Create a public URL for the API using Cloudfare. |
354
+ | `--public-api-id PUBLIC_API_ID` | Tunnel ID for named Cloudflare Tunnel. Use together with public-api option. |
355
+ | `--api-port API_PORT` | The listening port for the API. |
356
+ | `--api-key API_KEY` | API authentication key. |
357
+ | `--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. |
358
+ | `--nowebui` | Do not launch the Gradio UI. Useful for launching the API in standalone mode. |
359
+
360
+ #### Multimodal
361
+
362
+ | Flag | Description |
363
+ |---------------------------------------|-------------|
364
+ | `--multimodal-pipeline PIPELINE` | The multimodal pipeline to use. Examples: `llava-7b`, `llava-13b`. |
365
+
366
+ </details>
367
+
368
+ ## Documentation
369
+
370
+ https://github.com/oobabooga/text-generation-webui/wiki
371
+
372
+ ## Downloading models
373
+
374
+ 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).
375
+
376
+ * GGUF models are a single file and should be placed directly into `models`. Example:
377
+
378
+ ```
379
+ text-generation-webui
380
+ └── models
381
+ └── llama-2-13b-chat.Q4_K_M.gguf
382
+ ```
383
+
384
+ * 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:
385
+
386
+ ```
387
+ text-generation-webui
388
+ ├── models
389
+ │   ├── lmsys_vicuna-33b-v1.3
390
+ │   │   ├── config.json
391
+ │   │   ├── generation_config.json
392
+ │   │   ├── pytorch_model-00001-of-00007.bin
393
+ │   │   ├── pytorch_model-00002-of-00007.bin
394
+ │   │   ├── pytorch_model-00003-of-00007.bin
395
+ │   │   ├── pytorch_model-00004-of-00007.bin
396
+ │   │   ├── pytorch_model-00005-of-00007.bin
397
+ │   │   ├── pytorch_model-00006-of-00007.bin
398
+ │   │   ├── pytorch_model-00007-of-00007.bin
399
+ │   │   ├── pytorch_model.bin.index.json
400
+ │   │   ├── special_tokens_map.json
401
+ │   │   ├── tokenizer_config.json
402
+ │   │   └── tokenizer.model
403
+ ```
404
+
405
+ 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
406
+
407
+ ```
408
+ python download-model.py organization/model
409
+ ```
410
+
411
+ Run `python download-model.py --help` to see all the options.
412
+
413
+ ## Google Colab notebook
414
+
415
+ https://colab.research.google.com/github/oobabooga/text-generation-webui/blob/main/Colab-TextGen-GPU.ipynb
416
+
417
+ ## Contributing
418
+
419
+ If you would like to contribute to the project, check out the [Contributing guidelines](https://github.com/oobabooga/text-generation-webui/wiki/Contributing-guidelines).
420
+
421
+ ## Community
422
+
423
+ * Subreddit: https://www.reddit.com/r/oobabooga/
424
+ * Discord: https://discord.gg/jwZCF2dPQN
425
+
426
+ ## Acknowledgment
427
+
428
+ 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.
compose-dev.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ app:
3
+ entrypoint:
4
+ - sleep
5
+ - infinity
6
+ image: docker/dev-environments-default:stable-1
7
+ init: true
8
+ volumes:
9
+ - type: bind
10
+ source: /var/run/docker.sock
11
+ target: /var/run/docker.sock
12
+
css/NotoSans/NotoSans-Black.woff ADDED
Binary file (283 kB). View file
 
css/NotoSans/NotoSans-Black.woff2 ADDED
Binary file (189 kB). View file
 
css/NotoSans/NotoSans-BlackItalic.woff ADDED
Binary file (218 kB). View file
 
css/NotoSans/NotoSans-BlackItalic.woff2 ADDED
Binary file (144 kB). View file
 
css/NotoSans/NotoSans-Bold.woff ADDED
Binary file (277 kB). View file
 
css/NotoSans/NotoSans-Bold.woff2 ADDED
Binary file (183 kB). View file
 
css/NotoSans/NotoSans-BoldItalic.woff ADDED
Binary file (216 kB). View file
 
css/NotoSans/NotoSans-BoldItalic.woff2 ADDED
Binary file (142 kB). View file
 
css/NotoSans/NotoSans-ExtraBold.woff ADDED
Binary file (286 kB). View file
 
css/NotoSans/NotoSans-ExtraBold.woff2 ADDED
Binary file (194 kB). View file
 
css/NotoSans/NotoSans-ExtraBoldItalic.woff ADDED
Binary file (222 kB). View file
 
css/NotoSans/NotoSans-ExtraBoldItalic.woff2 ADDED
Binary file (149 kB). View file
 
css/NotoSans/NotoSans-ExtraLight.woff ADDED
Binary file (284 kB). View file
 
css/NotoSans/NotoSans-ExtraLight.woff2 ADDED
Binary file (190 kB). View file
 
css/NotoSans/NotoSans-ExtraLightItalic.woff ADDED
Binary file (226 kB). View file
 
css/NotoSans/NotoSans-ExtraLightItalic.woff2 ADDED
Binary file (151 kB). View file
 
css/NotoSans/NotoSans-Italic.woff ADDED
Binary file (218 kB). View file
 
css/NotoSans/NotoSans-Italic.woff2 ADDED
Binary file (144 kB). View file
 
css/NotoSans/NotoSans-Light.woff ADDED
Binary file (282 kB). View file
 
css/NotoSans/NotoSans-Light.woff2 ADDED
Binary file (190 kB). View file
 
css/NotoSans/NotoSans-LightItalic.woff ADDED
Binary file (224 kB). View file
 
css/NotoSans/NotoSans-LightItalic.woff2 ADDED
Binary file (149 kB). View file
 
css/NotoSans/NotoSans-Medium.woff ADDED
Binary file (283 kB). View file
 
css/NotoSans/NotoSans-Medium.woff2 ADDED
Binary file (191 kB). View file
 
css/NotoSans/NotoSans-MediumItalic.woff ADDED
Binary file (222 kB). View file
 
css/NotoSans/NotoSans-MediumItalic.woff2 ADDED
Binary file (147 kB). View file
 
css/NotoSans/NotoSans-Regular.woff ADDED
Binary file (278 kB). View file
 
css/NotoSans/NotoSans-Regular.woff2 ADDED
Binary file (186 kB). View file
 
css/NotoSans/NotoSans-SemiBold.woff ADDED
Binary file (283 kB). View file
 
css/NotoSans/NotoSans-SemiBold.woff2 ADDED
Binary file (192 kB). View file
 
css/NotoSans/NotoSans-SemiBoldItalic.woff ADDED
Binary file (221 kB). View file
 
css/NotoSans/NotoSans-SemiBoldItalic.woff2 ADDED
Binary file (147 kB). View file
 
css/NotoSans/NotoSans-Thin.woff ADDED
Binary file (276 kB). View file
 
css/NotoSans/NotoSans-Thin.woff2 ADDED
Binary file (181 kB). View file
 
css/NotoSans/NotoSans-ThinItalic.woff ADDED
Binary file (221 kB). View file
 
css/NotoSans/NotoSans-ThinItalic.woff2 ADDED
Binary file (145 kB). View file
 
css/NotoSans/stylesheet.css ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Copied from https://github.com/SillyTavern/SillyTavern/tree/6c8bd06308c69d51e2eb174541792a870a83d2d6/public/webfonts/NotoSans
3
+ */
4
+
5
+ @font-face {
6
+ font-family: 'Noto Sans';
7
+ src: url('file/css/NotoSans/NotoSans-Black.woff2') format('woff2'),
8
+ url('file/css/NotoSans/NotoSans-Black.woff') format('woff');
9
+ font-weight: 900;
10
+ font-style: normal;
11
+ font-display: swap;
12
+ }
13
+
14
+ @font-face {
15
+ font-family: 'Noto Sans';
16
+ src: url('file/css/NotoSans/NotoSans-ExtraBoldItalic.woff2') format('woff2'),
17
+ url('file/css/NotoSans/NotoSans-ExtraBoldItalic.woff') format('woff');
18
+ font-weight: bold;
19
+ font-style: italic;
20
+ font-display: swap;
21
+ }
22
+
23
+ @font-face {
24
+ font-family: 'Noto Sans';
25
+ src: url('file/css/NotoSans/NotoSans-BlackItalic.woff2') format('woff2'),
26
+ url('file/css/NotoSans/NotoSans-BlackItalic.woff') format('woff');
27
+ font-weight: 900;
28
+ font-style: italic;
29
+ font-display: swap;
30
+ }
31
+
32
+ @font-face {
33
+ font-family: 'Noto Sans';
34
+ src: url('file/css/NotoSans/NotoSans-ExtraBold.woff2') format('woff2'),
35
+ url('file/css/NotoSans/NotoSans-ExtraBold.woff') format('woff');
36
+ font-weight: bold;
37
+ font-style: normal;
38
+ font-display: swap;
39
+ }
40
+
41
+ @font-face {
42
+ font-family: 'Noto Sans';
43
+ src: url('file/css/NotoSans/NotoSans-ThinItalic.woff2') format('woff2'),
44
+ url('file/css/NotoSans/NotoSans-ThinItalic.woff') format('woff');
45
+ font-weight: 100;
46
+ font-style: italic;
47
+ font-display: swap;
48
+ }
49
+
50
+ @font-face {
51
+ font-family: 'Noto Sans';
52
+ src: url('file/css/NotoSans/NotoSans-BoldItalic.woff2') format('woff2'),
53
+ url('file/css/NotoSans/NotoSans-BoldItalic.woff') format('woff');
54
+ font-weight: bold;
55
+ font-style: italic;
56
+ font-display: swap;
57
+ }
58
+
59
+ @font-face {
60
+ font-family: 'Noto Sans';
61
+ src: url('file/css/NotoSans/NotoSans-Bold.woff2') format('woff2'),
62
+ url('file/css/NotoSans/NotoSans-Bold.woff') format('woff');
63
+ font-weight: bold;
64
+ font-style: normal;
65
+ font-display: swap;
66
+ }
67
+
68
+ @font-face {
69
+ font-family: 'Noto Sans';
70
+ src: url('file/css/NotoSans/NotoSans-LightItalic.woff2') format('woff2'),
71
+ url('file/css/NotoSans/NotoSans-LightItalic.woff') format('woff');
72
+ font-weight: 300;
73
+ font-style: italic;
74
+ font-display: swap;
75
+ }
76
+
77
+ @font-face {
78
+ font-family: 'Noto Sans';
79
+ src: url('file/css/NotoSans/NotoSans-Italic.woff2') format('woff2'),
80
+ url('file/css/NotoSans/NotoSans-Italic.woff') format('woff');
81
+ font-weight: normal;
82
+ font-style: italic;
83
+ font-display: swap;
84
+ }
85
+
86
+ @font-face {
87
+ font-family: 'Noto Sans';
88
+ src: url('file/css/NotoSans/NotoSans-ExtraLightItalic.woff2') format('woff2'),
89
+ url('file/css/NotoSans/NotoSans-ExtraLightItalic.woff') format('woff');
90
+ font-weight: 200;
91
+ font-style: italic;
92
+ font-display: swap;
93
+ }
94
+
95
+ @font-face {
96
+ font-family: 'Noto Sans';
97
+ src: url('file/css/NotoSans/NotoSans-Light.woff2') format('woff2'),
98
+ url('file/css/NotoSans/NotoSans-Light.woff') format('woff');
99
+ font-weight: 300;
100
+ font-style: normal;
101
+ font-display: swap;
102
+ }
103
+
104
+ @font-face {
105
+ font-family: 'Noto Sans';
106
+ src: url('file/css/NotoSans/NotoSans-ExtraLight.woff2') format('woff2'),
107
+ url('file/css/NotoSans/NotoSans-ExtraLight.woff') format('woff');
108
+ font-weight: 200;
109
+ font-style: normal;
110
+ font-display: swap;
111
+ }
112
+
113
+ @font-face {
114
+ font-family: 'Noto Sans';
115
+ src: url('file/css/NotoSans/NotoSans-Medium.woff2') format('woff2'),
116
+ url('file/css/NotoSans/NotoSans-Medium.woff') format('woff');
117
+ font-weight: 500;
118
+ font-style: normal;
119
+ font-display: swap;
120
+ }
121
+
122
+ @font-face {
123
+ font-family: 'Noto Sans';
124
+ src: url('file/css/NotoSans/NotoSans-Regular.woff2') format('woff2'),
125
+ url('file/css/NotoSans/NotoSans-Regular.woff') format('woff');
126
+ font-weight: normal;
127
+ font-style: normal;
128
+ font-display: swap;
129
+ }
130
+
131
+ @font-face {
132
+ font-family: 'Noto Sans';
133
+ src: url('file/css/NotoSans/NotoSans-MediumItalic.woff2') format('woff2'),
134
+ url('file/css/NotoSans/NotoSans-MediumItalic.woff') format('woff');
135
+ font-weight: 500;
136
+ font-style: italic;
137
+ font-display: swap;
138
+ }
139
+
140
+ @font-face {
141
+ font-family: 'Noto Sans';
142
+ src: url('file/css/NotoSans/NotoSans-SemiBoldItalic.woff2') format('woff2'),
143
+ url('file/css/NotoSans/NotoSans-SemiBoldItalic.woff') format('woff');
144
+ font-weight: 600;
145
+ font-style: italic;
146
+ font-display: swap;
147
+ }
148
+
149
+ @font-face {
150
+ font-family: 'Noto Sans';
151
+ src: url('file/css/NotoSans/NotoSans-SemiBold.woff2') format('woff2'),
152
+ url('file/css/NotoSans/NotoSans-SemiBold.woff') format('woff');
153
+ font-weight: 600;
154
+ font-style: normal;
155
+ font-display: swap;
156
+ }
157
+
158
+ @font-face {
159
+ font-family: 'Noto Sans';
160
+ src: url('file/css/NotoSans/NotoSans-Thin.woff2') format('woff2'),
161
+ url('file/css/NotoSans/NotoSans-Thin.woff') format('woff');
162
+ font-weight: 100;
163
+ font-style: normal;
164
+ font-display: swap;
165
+ }
166
+
css/chat_style-TheEncrypted777.css ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* All credits to TheEncrypted777: https://www.reddit.com/r/Oobabooga/comments/12xe6vq/updated_css_styling_with_color_customization_for/ */
2
+
3
+ .message {
4
+ display: grid;
5
+ grid-template-columns: 60px minmax(0, 1fr);
6
+ padding-bottom: 28px;
7
+ font-size: 18px;
8
+ font-family: 'Noto Sans', Arial, sans-serif;
9
+ line-height: 1.428571429;
10
+ }
11
+
12
+ .circle-you,
13
+ .circle-bot {
14
+ background-color: gray;
15
+ border-radius: 1rem;
16
+ border: 2px solid white;
17
+ }
18
+
19
+ .circle-bot img,
20
+ .circle-you img {
21
+ border-radius: 10%;
22
+ width: 100%;
23
+ height: 100%;
24
+ object-fit: cover;
25
+ }
26
+
27
+ .circle-you, .circle-bot {
28
+ /* You can set the size of the profile images here, but if you do, you have to also adjust the .text{padding-left: 90px} to a different number according to the width of the image which is right below here */
29
+ width: 135px;
30
+ height: 175px;
31
+ }
32
+
33
+ .text {
34
+ /* Change this to move the message box further left or right depending on the size of your profile pic */
35
+ padding-left: 90px;
36
+ text-shadow: 2px 2px 2px rgb(0 0 0 / 40%);
37
+ }
38
+
39
+ .text p {
40
+ margin-top: 2px;
41
+ }
42
+
43
+ .username {
44
+ padding-left: 10px;
45
+ font-size: 22px;
46
+ font-weight: bold;
47
+ border-top: 1px solid rgb(51 64 90);
48
+ padding: 3px;
49
+ }
50
+
51
+ .message-body {
52
+ position: relative;
53
+ border: 1px solid rgb(255 255 255 / 45.9%);
54
+ border-radius: 10px;
55
+ padding: 10px;
56
+ padding-top: 5px;
57
+
58
+ /* Message gradient background color - remove the line bellow if you don't want a background color or gradient */
59
+ background: linear-gradient(to bottom, #171730, #1b263f);
60
+ }
61
+
62
+ /* Adds 2 extra lines at the top and bottom of the message */
63
+ .message-body::before,
64
+ .message-body::after {
65
+ content: "";
66
+ position: absolute;
67
+ left: 10px;
68
+ right: 10px;
69
+ height: 1px;
70
+ background-color: rgb(255 255 255 / 13%);
71
+ }
72
+
73
+ .message-body::before {
74
+ top: 6px;
75
+ }
76
+
77
+ .message-body::after {
78
+ bottom: 6px;
79
+ }
80
+
81
+ .message-body img {
82
+ max-width: 300px;
83
+ max-height: 300px;
84
+ border-radius: 20px;
85
+ }
86
+
87
+ .message-body p {
88
+ margin-bottom: 0 !important;
89
+ font-size: 18px !important;
90
+ line-height: 1.428571429 !important;
91
+ color: rgb(243 244 246) !important;
92
+ text-shadow: 2px 2px 2px rgb(0 0 0);
93
+ }
94
+
95
+ .message-body p em {
96
+ color: rgb(138 138 138) !important;
97
+ }
98
+
99
+ @media screen and (width <= 688px) {
100
+ .message {
101
+ display: grid;
102
+ grid-template-columns: 60px minmax(0, 1fr);
103
+ padding-bottom: 25px;
104
+ font-size: 15px;
105
+ font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
106
+ line-height: 1.428571429;
107
+ }
108
+
109
+ .circle-you, .circle-bot {
110
+ width: 50px;
111
+ height: 73px;
112
+ border-radius: 0.5rem;
113
+ }
114
+
115
+ .circle-bot img,
116
+ .circle-you img {
117
+ width: 100%;
118
+ height: 100%;
119
+ object-fit: cover;
120
+ }
121
+
122
+ .text {
123
+ padding-left: 0;
124
+ }
125
+
126
+ .message-body p {
127
+ font-size: 16px !important;
128
+ }
129
+
130
+ .username {
131
+ font-size: 20px;
132
+ }
133
+ }
css/chat_style-cai-chat-square.css ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url("file/css/chat_style-cai-chat.css");
2
+
3
+ .circle-bot, .circle-you {
4
+ height: 90px;
5
+ width: 60px;
6
+ border-radius: 10px;
7
+ background-color: #656565;
8
+ }
9
+
10
+ .circle-bot img, .circle-you img {
11
+ border-radius: 8.333px;
12
+ }
13
+
14
+ .circle-you {
15
+ background-color: #656565;
16
+ }
17
+
18
+ .message {
19
+ padding-bottom: 30px;
20
+ grid-template-columns: 70px minmax(0, 1fr);
21
+ }
css/chat_style-cai-chat.css ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .message {
2
+ display: grid;
3
+ grid-template-columns: 60px minmax(0, 1fr);
4
+ padding-bottom: 15px;
5
+ font-size: 15px;
6
+ font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
7
+ line-height: 22.5px !important;
8
+ }
9
+
10
+ .message-body {
11
+ margin-top: 3px;
12
+ }
13
+
14
+ .circle-you {
15
+ width: 50px;
16
+ height: 50px;
17
+ background-color: rgb(238 78 59);
18
+ border-radius: 50%;
19
+ }
20
+
21
+ .circle-bot {
22
+ width: 50px;
23
+ height: 50px;
24
+ background-color: rgb(59 78 244);
25
+ border-radius: 50%;
26
+ }
27
+
28
+ .circle-bot img,
29
+ .circle-you img {
30
+ border-radius: 50%;
31
+ width: 100%;
32
+ height: 100%;
33
+ object-fit: cover;
34
+ }
35
+
36
+ .username {
37
+ font-weight: bold;
38
+ }
39
+
40
+ .message-body img {
41
+ max-width: 300px;
42
+ max-height: 300px;
43
+ border-radius: 20px;
44
+ }
45
+
46
+ .message-body p {
47
+ font-size: 15px !important;
48
+ line-height: 22.5px !important;
49
+ }
50
+
51
+ .message-body p, .chat .message-body ul, .chat .message-body ol {
52
+ margin-bottom: 10px !important;
53
+ }
54
+
55
+ .dark .message-body p em {
56
+ color: rgb(138 138 138) !important;
57
+ }
58
+
59
+ .message-body p em {
60
+ color: rgb(110 110 110) !important;
61
+ font-weight: 500;
62
+ }
css/chat_style-messenger.css ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .message {
2
+ padding-bottom: 25px;
3
+ font-size: 15px;
4
+ font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
5
+ line-height: 1.428571429;
6
+ }
7
+
8
+ .circle-you {
9
+ width: 50px;
10
+ height: 50px;
11
+ background-color: rgb(238 78 59);
12
+ border-radius: 50%;
13
+ }
14
+
15
+ .circle-bot {
16
+ width: 50px;
17
+ height: 50px;
18
+ background-color: rgb(59 78 244);
19
+ border-radius: 50%;
20
+ float: left;
21
+ margin-right: 10px;
22
+ margin-top: 5px;
23
+ }
24
+
25
+ .circle-bot img,
26
+ .circle-you img {
27
+ border-radius: 50%;
28
+ width: 100%;
29
+ height: 100%;
30
+ object-fit: cover;
31
+ }
32
+
33
+ .circle-you {
34
+ margin-top: 5px;
35
+ float: right;
36
+ }
37
+
38
+ .circle-bot + .text, .circle-you + .text {
39
+ border-radius: 18px;
40
+ padding: 8px 12px;
41
+ }
42
+
43
+ .circle-bot + .text {
44
+ background-color: #E4E6EB;
45
+ float: left;
46
+ }
47
+
48
+ .circle-you + .text {
49
+ float: right;
50
+ background-color: rgb(0 132 255);
51
+ margin-right: 10px;
52
+ }
53
+
54
+ .circle-you + .text div, .circle-you + .text *, .dark .circle-you + .text div, .dark .circle-you + .text * {
55
+ color: #FFF !important;
56
+ }
57
+
58
+ .circle-you + .text .username {
59
+ text-align: right;
60
+ }
61
+
62
+ .dark .circle-bot + .text div, .dark .circle-bot + .text * {
63
+ color: #000;
64
+ }
65
+
66
+ .text {
67
+ max-width: 80%;
68
+ }
69
+
70
+ .text p {
71
+ margin-top: 5px;
72
+ }
73
+
74
+ .username {
75
+ font-weight: bold;
76
+ }
77
+
78
+ .message-body {
79
+ }
80
+
81
+ .message-body img {
82
+ max-width: 300px;
83
+ max-height: 300px;
84
+ border-radius: 20px;
85
+ }
86
+
87
+ .message-body p {
88
+ margin-bottom: 0 !important;
89
+ font-size: 15px !important;
90
+ line-height: 1.428571429 !important;
91
+ }
92
+
93
+ .dark .message-body p em {
94
+ color: rgb(138 138 138) !important;
95
+ }
96
+
97
+ .message-body p em {
98
+ color: rgb(110 110 110) !important;
99
+ }
css/chat_style-wpp.css ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .message {
2
+ padding-bottom: 25px;
3
+ font-size: 15px;
4
+ font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
5
+ line-height: 1.428571429;
6
+ }
7
+
8
+ .text-you {
9
+ background-color: #d9fdd3;
10
+ border-radius: 15px;
11
+ padding: 10px;
12
+ padding-top: 5px;
13
+ float: right;
14
+ }
15
+
16
+ .text-bot {
17
+ background-color: #f2f2f2;
18
+ border-radius: 15px;
19
+ padding: 10px;
20
+ padding-top: 5px;
21
+ }
22
+
23
+ .dark .text-you {
24
+ background-color: #005c4b;
25
+ color: #111b21;
26
+ }
27
+
28
+ .dark .text-bot {
29
+ background-color: #1f2937;
30
+ color: #111b21;
31
+ }
32
+
33
+ .text-bot p, .text-you p {
34
+ margin-top: 5px;
35
+ }
36
+
37
+ .message-body img {
38
+ max-width: 300px;
39
+ max-height: 300px;
40
+ border-radius: 20px;
41
+ }
42
+
43
+ .message-body p {
44
+ margin-bottom: 0 !important;
45
+ font-size: 15px !important;
46
+ line-height: 1.428571429 !important;
47
+ }
48
+
49
+ .dark .message-body p em {
50
+ color: rgb(138 138 138) !important;
51
+ }
52
+
53
+ .message-body p em {
54
+ color: rgb(110 110 110) !important;
55
+ }
css/html_4chan_style.css ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #parent #container {
2
+ background-color: #eef2ff;
3
+ padding: 17px;
4
+ }
5
+
6
+ #parent #container .reply {
7
+ background-color: rgb(214 218 240);
8
+ border-bottom: 1px solid rgb(183 197 217);
9
+ border-image: none 100% 1 0 stretch;
10
+ border-left: 0 none rgb(0 0 0);
11
+ border-right: 1px solid rgb(183 197 217);
12
+ color: rgb(0 0 0);
13
+ display: table;
14
+ font-family: arial, helvetica, sans-serif;
15
+ font-size: 13.3333px;
16
+ margin: 4px 0;
17
+ overflow: hidden hidden;
18
+ padding: 4px 2px;
19
+ }
20
+
21
+ #parent #container .number {
22
+ color: rgb(0 0 0);
23
+ font-family: arial, helvetica, sans-serif;
24
+ font-size: 13.3333px;
25
+ width: 342.65px;
26
+ margin-right: 7px;
27
+ }
28
+
29
+ #parent #container .op {
30
+ color: rgb(0 0 0);
31
+ font-family: arial, helvetica, sans-serif;
32
+ font-size: 13.3333px;
33
+ margin: 4px 0 8px;
34
+ overflow: hidden hidden;
35
+ }
36
+
37
+ #parent #container .op blockquote {
38
+ margin-left: 0 !important;
39
+ }
40
+
41
+ #parent #container .name {
42
+ color: rgb(17 119 67);
43
+ font-family: arial, helvetica, sans-serif;
44
+ font-size: 13.3333px;
45
+ font-weight: 700;
46
+ margin-left: 7px;
47
+ }
48
+
49
+ #parent #container .quote {
50
+ color: rgb(221 0 0);
51
+ font-family: arial, helvetica, sans-serif;
52
+ font-size: 13.3333px;
53
+ text-decoration: underline solid rgb(221 0 0);
54
+ text-decoration-thickness: auto;
55
+ }
56
+
57
+ #parent #container .greentext {
58
+ color: rgb(120 153 34);
59
+ font-family: arial, helvetica, sans-serif;
60
+ font-size: 13.3333px;
61
+ }
62
+
63
+ #parent #container blockquote {
64
+ margin: 0 !important;
65
+ margin-block: 1em 1em;
66
+ margin-inline: 40px 40px;
67
+ margin: 13.33px 40px !important;
68
+ }
69
+
70
+ #parent #container .message_4chan {
71
+ color: black;
72
+ border: none;
73
+ }
css/html_instruct_style.css ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .chat {
2
+ background: var(--block-background-fill);
3
+ padding: 24px 19px;
4
+ padding-right: 19px !important;
5
+ padding-top: 0;
6
+ border: 1px solid var(--block-border-color);
7
+ }
8
+
9
+ .chat > .messages {
10
+ padding-top: 28px !important;
11
+ }
12
+
13
+ .message {
14
+ display: grid;
15
+ grid-template-columns: 60px 1fr;
16
+ padding-bottom: 25px;
17
+ font-size: 15px;
18
+ font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
19
+ line-height: 24px;
20
+ }
21
+
22
+ .message:first-child {
23
+ padding-top: 0;
24
+ }
25
+
26
+ .username {
27
+ display: none;
28
+ }
29
+
30
+ .message-body p, .message-body li {
31
+ font-size: 15px !important;
32
+ line-height: 24px !important;
33
+ }
34
+
35
+ .message-body p, .chat .message-body ul, .chat .message-body ol {
36
+ margin-bottom: 16px !important;
37
+ }
38
+
39
+ .message-body p:last-child, .chat .message-body ul:last-child, .chat .message-body ol:last-child {
40
+ margin-bottom: 0 !important;
41
+ }
42
+
43
+ .dark .message-body p em {
44
+ color: rgb(198 202 214) !important;
45
+ }
46
+
47
+ .message-body p em {
48
+ color: rgb(110 110 110) !important;
49
+ }
50
+
51
+ .gradio-container .chat .assistant-message {
52
+ padding: 20px;
53
+ background: var(--background-fill-secondary);
54
+ margin-top: 12px !important;
55
+ margin-bottom: 24px !important;
56
+ margin-right: 16px;
57
+ border-radius: 22px;
58
+ border-bottom-left-radius: 0;
59
+ border: 1px solid var(--border-color-primary);
60
+ }
61
+
62
+ .gradio-container .chat .user-message {
63
+ padding: 20px;
64
+ background-color: var(--color-accent-soft);
65
+ margin-bottom: 12px !important;
66
+ margin-left: 16px;
67
+ border-radius: 22px;
68
+ border-bottom-right-radius: 0;
69
+ border: 1px solid var(--border-color-accent-subdued);
70
+ }
71
+
72
+ .gradio-container .chat .assistant-message:last-child, .gradio-container .chat .user-message:last-child {
73
+ margin-bottom: 0 !important;
74
+ }
75
+
76
+ code {
77
+ background-color: #f3f4f6 !important;
78
+ }
79
+
80
+ .dark code {
81
+ background-color: #1f2937 !important;
82
+ }
css/html_readable_style.css ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .readable-container {
2
+ max-width: 600px;
3
+ margin-left: auto;
4
+ margin-right: auto;
5
+ background-color: rgb(31 41 55);
6
+ padding: 3em;
7
+ word-break: break-word;
8
+ overflow-wrap: anywhere;
9
+ color: #efefef !important;
10
+ }
11
+
12
+ .readable-container p, .readable-container li {
13
+ font-size: 16px !important;
14
+ color: #efefef !important;
15
+ margin-bottom: 22px;
16
+ line-height: 1.4 !important;
17
+ }
18
+
19
+ .readable-container li > p {
20
+ display: inline !important;
21
+ }
22
+
23
+ .readable-container code {
24
+ overflow-x: auto;
25
+ }
26
+
27
+ .readable-container :not(pre) > code {
28
+ white-space: normal !important;
29
+ }
30
+
31
+ .readable-container .hoverable {
32
+ font-size: 14px;
33
+ }
css/main.css ADDED
@@ -0,0 +1,702 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .tabs.svelte-710i53 {
2
+ margin-top: 0
3
+ }
4
+
5
+ .py-6 {
6
+ padding-top: 2.5rem
7
+ }
8
+
9
+ .small-button {
10
+ min-width: 0 !important;
11
+ max-width: 171px;
12
+ height: 39.594px;
13
+ align-self: end;
14
+ }
15
+
16
+ .refresh-button {
17
+ max-width: 4.4em;
18
+ min-width: 2.2em !important;
19
+ height: 39.594px;
20
+ align-self: end;
21
+ line-height: 1em;
22
+ border-radius: 0.5em;
23
+ flex: none;
24
+ }
25
+
26
+ .refresh-button-small {
27
+ max-width: 2.2em;
28
+ }
29
+
30
+ .button_nowrap {
31
+ white-space: nowrap;
32
+ }
33
+
34
+ #slim-column {
35
+ flex: none !important;
36
+ min-width: 0 !important;
37
+ }
38
+
39
+ .slim-dropdown {
40
+ background-color: transparent !important;
41
+ border: none !important;
42
+ padding: 0 !important;
43
+ }
44
+
45
+ #download-label, #upload-label {
46
+ min-height: 0
47
+ }
48
+
49
+ .dark svg {
50
+ fill: white;
51
+ }
52
+
53
+ .dark a {
54
+ color: white !important;
55
+ }
56
+
57
+ ol li p, ul li p {
58
+ display: inline-block;
59
+ }
60
+
61
+ #chat-tab, #default-tab, #notebook-tab, #parameters, #chat-settings, #lora, #training-tab, #model-tab, #session-tab {
62
+ border: 0;
63
+ }
64
+
65
+ .gradio-container-3-18-0 .prose * h1, h2, h3, h4 {
66
+ color: white;
67
+ }
68
+
69
+ .gradio-container {
70
+ max-width: 100% !important;
71
+ padding-top: 0 !important;
72
+ }
73
+
74
+ #extensions {
75
+ margin-top: 5px;
76
+ margin-bottom: 35px;
77
+ }
78
+
79
+ .extension-tab {
80
+ border: 0 !important;
81
+ }
82
+
83
+ span.math.inline {
84
+ font-size: 27px;
85
+ vertical-align: baseline !important;
86
+ }
87
+
88
+ div.svelte-15lo0d8 > *, div.svelte-15lo0d8 > .form > * {
89
+ flex-wrap: nowrap;
90
+ }
91
+
92
+ .header_bar {
93
+ background-color: #f7f7f7;
94
+ box-shadow: 0 2px 3px rgba(22 22 22 / 35%);
95
+ margin-bottom: 0;
96
+ overflow-x: scroll;
97
+ margin-left: calc(-1 * var(--size-4));
98
+ margin-right: calc(-1 * var(--size-4));
99
+ display: block !important;
100
+ text-wrap: nowrap;
101
+ z-index: 90;
102
+ }
103
+
104
+ .dark .header_bar {
105
+ border: none !important;
106
+ box-shadow: 0 3px 4px rgba(20 20 20 / 60%);
107
+ background-color: #8080802b;
108
+ }
109
+
110
+ .header_bar button.selected {
111
+ border-radius: 0;
112
+ }
113
+
114
+ .textbox_default textarea {
115
+ height: calc(100dvh - 271px);
116
+ }
117
+
118
+ .textbox_default_output textarea {
119
+ height: calc(100dvh - 185px);
120
+ }
121
+
122
+ .textbox textarea {
123
+ height: calc(100dvh - 241px);
124
+ }
125
+
126
+ .textbox_logits textarea {
127
+ height: calc(100dvh - 236px);
128
+ }
129
+
130
+ .textbox_logits_notebook textarea {
131
+ height: calc(100dvh - 292px);
132
+ }
133
+
134
+ .monospace textarea {
135
+ font-family: monospace;
136
+ }
137
+
138
+ .textbox_default textarea,
139
+ .textbox_default_output textarea,
140
+ .textbox_logits textarea,
141
+ .textbox_logits_notebook textarea,
142
+ .textbox textarea {
143
+ font-size: 16px !important;
144
+ color: #46464A !important;
145
+ }
146
+
147
+ .dark textarea {
148
+ color: #efefef !important;
149
+ }
150
+
151
+ @media screen and (width <= 711px) {
152
+ .textbox_default textarea {
153
+ height: calc(100dvh - 259px);
154
+ }
155
+
156
+ div .default-token-counter {
157
+ top: calc( 0.5 * (100dvh - 236px) ) !important;
158
+ }
159
+
160
+ .transparent-substring {
161
+ display: none;
162
+ }
163
+
164
+ .hover-menu {
165
+ min-width: 250px !important;
166
+ }
167
+ }
168
+
169
+ /* Hide the gradio footer */
170
+ footer {
171
+ display: none !important;
172
+ }
173
+
174
+ button {
175
+ font-size: 14px !important;
176
+ }
177
+
178
+ .file-saver {
179
+ position: fixed !important;
180
+ height: 100%;
181
+ z-index: 1000;
182
+ background-color: rgb(0 0 0 / 50%) !important;
183
+ margin-left: -20px;
184
+ margin-right: -20px;
185
+ }
186
+
187
+ .file-saver > :first-child {
188
+ position: fixed !important;
189
+ top: 50%;
190
+ left: 50%;
191
+ transform: translate(-50%, -50%); /* center horizontally */
192
+ width: 100%;
193
+ max-width: 500px;
194
+ background-color: var(--input-background-fill);
195
+ border: var(--input-border-width) solid var(--input-border-color) !important;
196
+ }
197
+
198
+ .file-saver > :first-child > :last-child {
199
+ background: var(--block-background-fill);
200
+ justify-content: flex-end;
201
+ }
202
+
203
+ .checkboxgroup-table label {
204
+ background: none !important;
205
+ padding: 0 !important;
206
+ border: 0 !important;
207
+ }
208
+
209
+ .checkboxgroup-table div {
210
+ display: grid !important;
211
+ }
212
+
213
+ .markdown ul ol {
214
+ font-size: 100% !important;
215
+ }
216
+
217
+ .pretty_scrollbar::-webkit-scrollbar {
218
+ width: 5px;
219
+ }
220
+
221
+ .pretty_scrollbar::-webkit-scrollbar-track {
222
+ background: transparent;
223
+ }
224
+
225
+ .pretty_scrollbar::-webkit-scrollbar-thumb,
226
+ .pretty_scrollbar::-webkit-scrollbar-thumb:hover {
227
+ background: #c5c5d2;
228
+ }
229
+
230
+ .dark .pretty_scrollbar::-webkit-scrollbar-thumb,
231
+ .dark .pretty_scrollbar::-webkit-scrollbar-thumb:hover {
232
+ background: #374151;
233
+ }
234
+
235
+ .pretty_scrollbar::-webkit-resizer {
236
+ background: #c5c5d2;
237
+ }
238
+
239
+ .dark .pretty_scrollbar::-webkit-resizer {
240
+ background: #374151;
241
+ }
242
+
243
+ audio {
244
+ max-width: 100%;
245
+ }
246
+
247
+ /* Copied from https://github.com/AUTOMATIC1111/stable-diffusion-webui */
248
+ .token-counter {
249
+ position: absolute !important;
250
+ top: calc( 0.5 * (100dvh - 218px) ) !important;
251
+ right: 2px;
252
+ z-index: 100;
253
+ background: var(--input-background-fill) !important;
254
+ min-height: 0 !important;
255
+ }
256
+
257
+ .default-token-counter {
258
+ top: calc( 0.5 * (100dvh - 248px) ) !important;
259
+ }
260
+
261
+ .token-counter span {
262
+ padding: 1px;
263
+ box-shadow: 0 0 0 0.3em rgb(192 192 192 / 15%), inset 0 0 0.6em rgb(192 192 192 / 7.5%);
264
+ border: 2px solid rgb(192 192 192 / 40%) !important;
265
+ border-radius: 0.4em;
266
+ }
267
+
268
+ .no-background {
269
+ background: var(--background-fill-primary) !important;
270
+ padding: 0 !important;
271
+ }
272
+
273
+ /* ----------------------------------------------
274
+ Chat tab
275
+ ---------------------------------------------- */
276
+ .h-\[40vh\], .wrap.svelte-byatnx.svelte-byatnx.svelte-byatnx {
277
+ height: 66.67vh
278
+ }
279
+
280
+ .gradio-container {
281
+ margin-left: auto !important;
282
+ margin-right: auto !important;
283
+ }
284
+
285
+ .w-screen {
286
+ width: unset
287
+ }
288
+
289
+ div.svelte-362y77>*, div.svelte-362y77>.form>* {
290
+ flex-wrap: nowrap
291
+ }
292
+
293
+ .pending.svelte-1ed2p3z {
294
+ opacity: 1;
295
+ }
296
+
297
+ .wrap.svelte-6roggh.svelte-6roggh {
298
+ max-height: 92.5%;
299
+ }
300
+
301
+ /* This is for the microphone button in the whisper extension */
302
+ .sm.svelte-1ipelgc {
303
+ width: 100%;
304
+ }
305
+
306
+ #chat-tab {
307
+ padding-top: 0;
308
+ }
309
+
310
+ #chat-tab button#Generate, #chat-tab button#stop {
311
+ width: 89.3438px !important;
312
+ }
313
+
314
+ #chat-tab button, #notebook-tab button, #default-tab button {
315
+ min-width: 0 !important;
316
+ }
317
+
318
+ #chat-tab > :first-child, #extensions {
319
+ max-width: 880px;
320
+ margin-left: auto;
321
+ margin-right: auto;
322
+ }
323
+
324
+ @media screen and (width <= 688px) {
325
+ #chat-tab {
326
+ padding-left: 0;
327
+ padding-right: 0;
328
+ }
329
+ }
330
+
331
+ .chat {
332
+ margin-left: auto;
333
+ margin-right: auto;
334
+ max-width: 880px;
335
+ min-height: var(--chat-height);
336
+ overflow-y: auto;
337
+ padding-right: 15px;
338
+ display: flex;
339
+ flex-direction: column;
340
+ word-break: break-word;
341
+ overflow-wrap: anywhere;
342
+ border-top: none;
343
+ border-radius: 0 0 0 8px;
344
+ }
345
+
346
+ .chat-parent {
347
+ height: calc(100dvh - 98px - var(--header-height) - var(--input-delta));
348
+ overflow: auto !important;
349
+ border-radius: 0 !important;
350
+ margin-bottom: var(--input-delta) !important;
351
+ }
352
+
353
+ .old-ui .chat-parent {
354
+ height: calc(100dvh - 192px - var(--header-height) - var(--input-delta));
355
+ margin-bottom: var(--input-delta) !important;
356
+ }
357
+
358
+ .chat-parent.bigchat {
359
+ height: calc(100dvh - 98px - var(--header-height) - var(--input-delta)) !important;
360
+ margin-bottom: var(--input-delta) !important;
361
+ }
362
+
363
+ .chat > .messages {
364
+ display: flex;
365
+ flex-direction: column;
366
+ padding-top: 25px;
367
+ }
368
+
369
+ .chat .message:last-child {
370
+ margin-bottom: 0 !important;
371
+ padding-bottom: 0 !important;
372
+ }
373
+
374
+ .message-body li {
375
+ list-style-position: outside;
376
+ }
377
+
378
+ .chat .message-body ul, .chat .message-body ol {
379
+ padding-inline-start: 2em;
380
+ }
381
+
382
+ .message-body li:not(:last-child) {
383
+ margin-top: 0 !important;
384
+ margin-bottom: 2px !important;
385
+ }
386
+
387
+ .message-body li:last-child {
388
+ margin-bottom: 0 !important;
389
+ }
390
+
391
+ .message-body li > p {
392
+ display: inline !important;
393
+ }
394
+
395
+ .message-body ul, .message-body ol {
396
+ font-size: 15px !important;
397
+ }
398
+
399
+ .message-body ul {
400
+ list-style-type: disc !important;
401
+ }
402
+
403
+ .message-body pre:not(:last-child) {
404
+ margin-bottom: 35.625px !important;
405
+ }
406
+
407
+ .message-body pre:last-child {
408
+ margin-bottom: 0 !important;
409
+ }
410
+
411
+ .message-body code {
412
+ white-space: pre-wrap !important;
413
+ word-wrap: break-word !important;
414
+ border: 1px solid var(--border-color-primary);
415
+ border-radius: var(--radius-sm);
416
+ background: var(--background-fill-secondary);
417
+ font-size: 90%;
418
+ padding: 1px 3px;
419
+ }
420
+
421
+ .message-body pre > code {
422
+ display: block;
423
+ padding: 15px;
424
+ }
425
+
426
+ .message-body :not(pre) > code {
427
+ white-space: normal !important;
428
+ }
429
+
430
+ #chat-input {
431
+ padding: 0;
432
+ padding-top: 18px;
433
+ background: transparent;
434
+ border: none;
435
+ }
436
+
437
+ #chat-input textarea:focus {
438
+ box-shadow: none !important;
439
+ }
440
+
441
+ #chat-input > :first-child {
442
+ background-color: transparent;
443
+ }
444
+
445
+ #chat-input .progress-text {
446
+ display: none;
447
+ }
448
+
449
+ @media print {
450
+ body {
451
+ visibility: hidden;
452
+ }
453
+
454
+ .chat {
455
+ visibility: visible;
456
+ position: absolute;
457
+ left: 0;
458
+ top: 0;
459
+ max-width: unset;
460
+ max-height: unset;
461
+ width: 100%;
462
+ overflow-y: visible;
463
+ }
464
+
465
+ .message {
466
+ break-inside: avoid;
467
+ }
468
+
469
+ .gradio-container {
470
+ overflow: visible;
471
+ }
472
+
473
+ .tab-nav {
474
+ display: none !important;
475
+ }
476
+
477
+ #chat-tab > :first-child {
478
+ max-width: unset;
479
+ }
480
+ }
481
+
482
+ #show-controls {
483
+ position: absolute;
484
+ height: 100%;
485
+ background-color: var(--background-fill-primary);
486
+ border: 0 !important;
487
+ border-radius: 0;
488
+ }
489
+
490
+ #show-controls label {
491
+ z-index: 1000;
492
+ position: absolute;
493
+ right: 0;
494
+ white-space: nowrap;
495
+ overflow: hidden;
496
+ text-overflow: ellipsis;
497
+ }
498
+
499
+ #show-controls span {
500
+ opacity: 0.6;
501
+ }
502
+
503
+ #typing-container {
504
+ display: none;
505
+ position: absolute;
506
+ background-color: transparent;
507
+ left: -2px;
508
+ padding: var(--block-padding);
509
+ }
510
+
511
+ .typing {
512
+ position: relative;
513
+ }
514
+
515
+ .visible-dots #typing-container {
516
+ display: block;
517
+ }
518
+
519
+ .typing span {
520
+ content: '';
521
+ animation: blink 1.5s infinite;
522
+ animation-fill-mode: both;
523
+ height: 10px;
524
+ width: 10px;
525
+ background: #3b5998;;
526
+ position: absolute;
527
+ left:0;
528
+ top:0;
529
+ border-radius: 50%;
530
+ }
531
+
532
+ .typing .dot1 {
533
+ animation-delay: .2s;
534
+ margin-left: calc(10px * 1.5);
535
+ }
536
+
537
+ .typing .dot2 {
538
+ animation-delay: .4s;
539
+ margin-left: calc(10px * 3);
540
+ }
541
+
542
+ @keyframes blink {
543
+ 0% {
544
+ opacity: .1;
545
+ }
546
+
547
+ 20% {
548
+ opacity: 1;
549
+ }
550
+
551
+ 100% {
552
+ opacity: .1;
553
+ }
554
+ }
555
+
556
+ #chat-tab .generating {
557
+ display: none !important;
558
+ }
559
+
560
+ .hover-element {
561
+ position: relative;
562
+ font-size: 24px;
563
+ }
564
+
565
+ .hover-menu {
566
+ display: none;
567
+ position: absolute;
568
+ bottom: 80%;
569
+ left: 0;
570
+ background-color: var(--background-fill-secondary);
571
+ box-shadow: 0 0 10px rgb(0 0 0 / 50%);
572
+ z-index: 10000;
573
+ min-width: 330px;
574
+ flex-direction: column;
575
+ }
576
+
577
+ .hover-menu button {
578
+ width: 100%;
579
+ background: transparent !important;
580
+ border-radius: 0 !important;
581
+ justify-content: space-between;
582
+ margin: 0 !important;
583
+ height: 36px;
584
+ }
585
+
586
+ .hover-menu button:not(#clear-history-confirm) {
587
+ border-bottom: 0 !important;
588
+ }
589
+
590
+ .hover-menu button:not(#clear-history-confirm):last-child {
591
+ border-bottom: var(--button-border-width) solid var(--button-secondary-border-color) !important;
592
+ }
593
+
594
+ .hover-menu button:hover {
595
+ background: var(--button-secondary-background-fill-hover) !important;
596
+ }
597
+
598
+ .transparent-substring {
599
+ opacity: 0.333;
600
+ }
601
+
602
+ #chat-tab:not(.old-ui) #chat-buttons {
603
+ display: none !important;
604
+ }
605
+
606
+ #gr-hover-container {
607
+ min-width: 0 !important;
608
+ display: flex;
609
+ flex-direction: column-reverse;
610
+ padding-right: 20px;
611
+ padding-bottom: 3px;
612
+ flex-grow: 0 !important;
613
+ }
614
+
615
+ #generate-stop-container {
616
+ min-width: 0 !important;
617
+ display: flex;
618
+ flex-direction: column-reverse;
619
+ padding-bottom: 3px;
620
+ flex: 0 auto !important;
621
+ }
622
+
623
+ #chat-input-container {
624
+ min-width: 0 !important;
625
+ }
626
+
627
+ #chat-input-container > .form {
628
+ background: transparent;
629
+ border: none;
630
+ }
631
+
632
+ #chat-input-row {
633
+ padding-bottom: 20px;
634
+ }
635
+
636
+ .old-ui #chat-input-row, #chat-input-row.bigchat {
637
+ padding-bottom: 0 !important;
638
+ }
639
+
640
+ #chat-col {
641
+ padding-bottom: 100px;
642
+ }
643
+
644
+ .old-ui #chat-col, #chat-col.bigchat {
645
+ padding-bottom: 80px !important;
646
+ }
647
+
648
+ .old-ui #chat-buttons #clear-history-confirm {
649
+ order: -1;
650
+ }
651
+
652
+ .chat ol, .chat ul {
653
+ margin-top: 6px !important;
654
+ }
655
+
656
+ /* ----------------------------------------------
657
+ Past chats menus
658
+ ---------------------------------------------- */
659
+ #rename-row label {
660
+ margin-top: var(--layout-gap);
661
+ }
662
+
663
+ /* ----------------------------------------------
664
+ Past chat histories in a side bar on desktop
665
+ ---------------------------------------------- */
666
+ @media screen and (width >= 1327px) {
667
+ #past-chats-row {
668
+ position: absolute;
669
+ top: 16px;
670
+ left: 0;
671
+ width: calc(0.5*(var(--document-width) - 880px - 120px - 16px*2));
672
+ max-width: 300px;
673
+ margin-left: calc(-0.5*(var(--document-width) - 880px - 14px - 16px * 2));
674
+ }
675
+ }
676
+
677
+ /* ----------------------------------------------
678
+ Keep dropdown menus above errored components
679
+ ---------------------------------------------- */
680
+ .options {
681
+ z-index: 100 !important;
682
+ }
683
+
684
+ /* ----------------------------------------------
685
+ Big profile picture for characters
686
+ ---------------------------------------------- */
687
+ .bigProfilePicture {
688
+ position: fixed;
689
+ bottom: 0;
690
+ left: 0;
691
+ width: calc((100vw - 880px - 120px) /2);
692
+ }
693
+
694
+ .pfp_character:hover {
695
+ cursor: pointer;
696
+ }
697
+
698
+ @media screen and (width <= 1300px) {
699
+ .bigProfilePicture {
700
+ display: none;
701
+ }
702
+ }
docker/.dockerignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ .env
2
+ Dockerfile
3
+ /characters
4
+ /loras
5
+ /models
6
+ /presets
7
+ /prompts
8
+ /training