Skip to content

Commit 6915c50

Browse files
authored
Merge pull request oobabooga#6166 from oobabooga/dev
Merge dev branch
2 parents 4820ae9 + 8ec8bc0 commit 6915c50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+524
-245
lines changed

Diff for: .github/workflows/stale.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
- uses: actions/stale@v5
1414
with:
1515
stale-issue-message: ""
16-
close-issue-message: "This issue has been closed due to inactivity for 2 months. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment."
17-
days-before-issue-stale: 60
16+
close-issue-message: "This issue has been closed due to inactivity for 6 months. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment."
17+
days-before-issue-stale: 180
1818
days-before-issue-close: 0
1919
stale-issue-label: "stale"
2020
days-before-pr-stale: -1

Diff for: README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Its goal is to become the [AUTOMATIC1111/stable-diffusion-webui](https://github.
1111
## Features
1212

1313
* 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).
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), [TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM).
1515
* Dropdown menu for quickly switching between different models.
1616
* 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.
1717
* [Chat with custom characters](https://github.com/oobabooga/text-generation-webui/wiki/03-%E2%80%90-Parameters-Tab#character).
@@ -76,12 +76,12 @@ conda activate textgen
7676

7777
| System | GPU | Command |
7878
|--------|---------|---------|
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` |
79+
| Linux/WSL | NVIDIA | `pip3 install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cu121` |
80+
| Linux/WSL | CPU only | `pip3 install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cpu` |
81+
| Linux | AMD | `pip3 install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/rocm5.6` |
82+
| MacOS + MPS | Any | `pip3 install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2` |
83+
| Windows | NVIDIA | `pip3 install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cu121` |
84+
| Windows | CPU only | `pip3 install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2` |
8585

8686
The up-to-date commands can be found here: https://pytorch.org/get-started/locally/.
8787

@@ -146,7 +146,7 @@ Then browse to
146146
1) For Kepler GPUs and older, you will need to install CUDA 11.8 instead of 12:
147147

148148
```
149-
pip3 install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/cu118
149+
pip3 install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cu118
150150
conda install -y -c "nvidia/label/cuda-11.8.0" cuda-runtime
151151
```
152152

Diff for: css/html_instruct_style.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262

6363
.gradio-container .chat .user-message {
6464
padding: 20px;
65-
padding-left: 0px;
66-
padding-right: 0px;
65+
padding-left: 0;
66+
padding-right: 0;
6767
background-color: transparent;
6868
border-radius: 8px;
6969
border-bottom-right-radius: 0;

Diff for: css/main.css

+53-4
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ gradio-app > :first-child {
9696

9797
.header_bar {
9898
background-color: #f7f7f7;
99-
box-shadow: 0 0px 3px rgba(22 22 22 / 35%);
99+
box-shadow: 0 0 3px rgba(22 22 22 / 35%);
100100
margin-bottom: 0;
101101
overflow-x: scroll;
102102
margin-left: calc(-1 * var(--size-4));
@@ -221,6 +221,7 @@ button {
221221

222222
.pretty_scrollbar::-webkit-scrollbar {
223223
width: 7px;
224+
height: 7px;
224225
}
225226

226227
.pretty_scrollbar::-webkit-scrollbar-track {
@@ -245,6 +246,10 @@ button {
245246
background: #374151;
246247
}
247248

249+
.pretty_scrollbar::-webkit-scrollbar-corner {
250+
background: transparent;
251+
}
252+
248253
audio {
249254
max-width: 100%;
250255
}
@@ -433,12 +438,12 @@ div.svelte-362y77>*, div.svelte-362y77>.form>* {
433438
.message-body code {
434439
white-space: pre-wrap !important;
435440
word-wrap: break-word !important;
436-
border: 1px solid #666666;
441+
border: 1px solid #666;
437442
border-radius: 5px;
438443
font-size: 82%;
439444
padding: 1px 3px;
440445
background: #0d1117 !important;
441-
color: rgb(201, 209, 217);
446+
color: rgb(201 209 217);
442447
}
443448

444449
.message-body pre > code {
@@ -695,7 +700,7 @@ div.svelte-362y77>*, div.svelte-362y77>.form>* {
695700
@media screen and (width >= 1327px) {
696701
#past-chats-row {
697702
position: absolute;
698-
top: 16px;
703+
top: 36px;
699704
left: 0;
700705
width: calc(0.5*(var(--document-width) - 880px - 120px - 16px*2));
701706
max-width: 300px;
@@ -743,3 +748,47 @@ div.svelte-362y77>*, div.svelte-362y77>.form>* {
743748
display: none;
744749
}
745750
}
751+
752+
#past-chats {
753+
max-height: calc(100vh - 195px);
754+
overflow-y: scroll !important;
755+
border-radius: 0;
756+
scrollbar-width: none; /* Hide scrollbar in Firefox by default */
757+
}
758+
759+
#past-chats label {
760+
width: 100%;
761+
background-color: transparent !important;
762+
background: none;
763+
border: 0;
764+
border-radius: 0;
765+
padding-top: 8px;
766+
padding-bottom: 8px;
767+
}
768+
769+
#past-chats > :nth-child(2) {
770+
display: none;
771+
}
772+
773+
#past-chats > :nth-child(3) {
774+
gap: 0;
775+
}
776+
777+
#past-chats::-webkit-scrollbar {
778+
display: none;
779+
}
780+
781+
#past-chats:hover {
782+
scrollbar-width: auto;
783+
}
784+
785+
#past-chats:hover::-webkit-scrollbar {
786+
display: block;
787+
}
788+
789+
@media screen and (width < 1327px) {
790+
#past-chats {
791+
max-height: 300px;
792+
}
793+
}
794+

Diff for: docker/TensorRT-LLM/Dockerfile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM pytorch/pytorch:2.2.1-cuda12.1-cudnn8-runtime
2+
3+
# Install Git
4+
RUN apt update && apt install -y git
5+
6+
# System-wide TensorRT-LLM requirements
7+
RUN apt install -y openmpi-bin libopenmpi-dev
8+
9+
# Set the working directory
10+
WORKDIR /app
11+
12+
# Install text-generation-webui
13+
RUN git clone https://github.com/oobabooga/text-generation-webui
14+
WORKDIR /app/text-generation-webui
15+
RUN pip install -r requirements.txt
16+
17+
# This is needed to avoid an error about "Failed to build mpi4py" in the next command
18+
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
19+
20+
# Install TensorRT-LLM
21+
RUN pip3 install tensorrt_llm==0.10.0 -U --pre --extra-index-url https://pypi.nvidia.com
22+
23+
# Expose the necessary port for the Python server
24+
EXPOSE 7860 5000
25+
26+
# Run the Python server.py script with the specified command
27+
CMD ["python", "server.py", "--api", "--listen"]

Diff for: docs/02 - Default and Notebook Tabs.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ In the **Prompt** menu, you can select from some predefined prompts defined unde
1818

1919
### Output
2020

21-
Four tabs can be found:
21+
Five tabs can be found:
2222

2323
* **Raw**: where the raw text generated by the model appears.
2424
* **Markdown**: it contains a "Render" button. You can click on it at any time to render the current output as markdown. This is particularly useful for models that generate LaTeX equations like GALACTICA.
2525
* **HTML**: displays the output in an HTML style that is meant to be easier to read. Its style is defined under `text-generation-webui/css/html_readable_style.css`.
2626
* **Logits**: when you click on "Get next token probabilities", this tab displays the 50 most likely next tokens and their probabilities based on your current input. If "Use samplers" is checked, the probabilities will be the ones after the sampling parameters in the "Parameters" > "Generation" tab are applied. Otherwise, they will be the raw probabilities generated by the model.
27-
* **Tokens**: allows you to tokenize your prompt and see the ID numbers for the individuals tokens.
27+
* **Tokens**: allows you to tokenize your prompt and see the ID numbers for the individual tokens.
2828

2929
## Notebook tab
3030

Diff for: docs/12 - OpenAI API.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ print()
219219

220220
### Environment variables
221221

222-
The following environment variables can be used (they take precendence over everything else):
222+
The following environment variables can be used (they take precedence over everything else):
223223

224224
| Variable Name | Description | Example Value |
225225
|------------------------|------------------------------------|----------------------------|

Diff for: docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
These files is a mirror of the documentation at:
1+
These files are a mirror of the documentation at:
22

33
# https://github.com/oobabooga/text-generation-webui/wiki
44

Diff for: js/main.js

+5-14
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,6 @@ document.addEventListener("keydown", function(event) {
9898
document.getElementById("Impersonate").click();
9999
}
100100

101-
// Switch between tabs on Tab
102-
else if (!event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey && event.key === "Tab") {
103-
event.preventDefault();
104-
var parametersButton = document.getElementById("parameters-button");
105-
var parentContainer = parametersButton.parentNode;
106-
var selectedChild = parentContainer.querySelector(".selected");
107-
108-
if (selectedChild.id == "parameters-button") {
109-
document.getElementById(previousTabId).click();
110-
} else {
111-
previousTabId = selectedChild.id;
112-
parametersButton.click();
113-
}
114-
}
115101
});
116102

117103
//------------------------------------------------
@@ -548,3 +534,8 @@ document.querySelectorAll(".focus-on-chat-input").forEach(element => {
548534
document.querySelector("#chat-input textarea").focus();
549535
});
550536
});
537+
538+
//------------------------------------------------
539+
// Fix a border around the "past chats" menu
540+
//------------------------------------------------
541+
document.getElementById("past-chats").parentNode.style.borderRadius = "0px";

Diff for: modules/LoRA.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def add_lora_autogptq(lora_names):
7373
if len(lora_names) > 1:
7474
logger.warning('AutoGPTQ can only work with 1 LoRA at the moment. Only the first one in the list will be loaded.')
7575
if not shared.args.no_inject_fused_attention:
76-
logger.warning('Fused Atttention + AutoGPTQ may break Lora loading. Disable it.')
76+
logger.warning('Fused Attention + AutoGPTQ may break Lora loading. Disable it.')
7777

7878
peft_config = GPTQLoraConfig(
7979
inference_mode=True,

Diff for: modules/RoPE.py

-18
This file was deleted.

Diff for: modules/block_requests.py

+18-10
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,27 @@ def my_open(*args, **kwargs):
4343
with original_open(*args, **kwargs) as f:
4444
file_contents = f.read()
4545

46-
file_contents = file_contents.replace(b'\t\t<script\n\t\t\tsrc="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.9/iframeResizer.contentWindow.min.js"\n\t\t\tasync\n\t\t></script>', b'')
47-
file_contents = file_contents.replace(b'cdnjs.cloudflare.com', b'127.0.0.1')
46+
if len(args) > 1 and args[1] == 'rb':
47+
file_contents = file_contents.decode('utf-8')
48+
49+
file_contents = file_contents.replace('\t\t<script\n\t\t\tsrc="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.9/iframeResizer.contentWindow.min.js"\n\t\t\tasync\n\t\t></script>', '')
50+
file_contents = file_contents.replace('cdnjs.cloudflare.com', '127.0.0.1')
4851
file_contents = file_contents.replace(
49-
b'</head>',
50-
b'\n <script src="file/js/katex/katex.min.js"></script>'
51-
b'\n <script src="file/js/katex/auto-render.min.js"></script>'
52-
b'\n <script src="file/js/highlightjs/highlight.min.js"></script>'
53-
b'\n <script src="file/js/highlightjs/highlightjs-copy.min.js"></script>'
54-
b'\n <script>hljs.addPlugin(new CopyButtonPlugin());</script>'
55-
b'\n </head>'
52+
'</head>',
53+
'\n <script src="file/js/katex/katex.min.js"></script>'
54+
'\n <script src="file/js/katex/auto-render.min.js"></script>'
55+
'\n <script src="file/js/highlightjs/highlight.min.js"></script>'
56+
'\n <script src="file/js/highlightjs/highlightjs-copy.min.js"></script>'
57+
'\n <script>hljs.addPlugin(new CopyButtonPlugin());</script>'
58+
'\n </head>'
5659
)
5760

58-
return io.BytesIO(file_contents)
61+
if len(args) > 1 and args[1] == 'rb':
62+
file_contents = file_contents.encode('utf-8')
63+
return io.BytesIO(file_contents)
64+
else:
65+
return io.StringIO(file_contents)
66+
5967
else:
6068
return original_open(*args, **kwargs)
6169

0 commit comments

Comments
 (0)