Skip to content

Commit

Permalink
Merge branch 'main' of github.com:oobabooga/text-generation-webui
Browse files Browse the repository at this point in the history
  • Loading branch information
oobabooga committed Mar 15, 2023
2 parents ffb8986 + d3a280e commit b501722
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Open a terminal and copy and paste these commands one at a time ([install conda]
```
conda create -n textgen
conda activate textgen
conda install torchvision torchaudio pytorch-cuda=11.7 git -c pytorch -c nvidia
conda install torchvision=0.14.1 torchaudio=0.13.1 pytorch-cuda=11.7 git -c pytorch -c nvidia
git clone https://github.com/oobabooga/text-generation-webui
cd text-generation-webui
pip install -r requirements.txt
Expand All @@ -51,17 +51,18 @@ The third line assumes that you have an NVIDIA GPU.
* If you have an AMD GPU, replace the third command with this one:

```
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.2
pip3 install torch torchvision=0.14.1 torchaudio=0.13.1 --extra-index-url https://download.pytorch.org/whl/rocm5.2
```

* If you are running it in CPU mode, replace the third command with this one:

```
conda install pytorch torchvision torchaudio git -c pytorch
conda install pytorch torchvision=0.14.1 torchaudio=0.13.1 git -c pytorch
```

> **Note**
> 1. If you are on Windows, it may be easier to run the commands above in a WSL environment. The performance may also be better.
> 1. If you are on Windows, it may be easier to run the commands above in a WSL environment. The performance may also be better. A full guide can be found here: [Windows Subsystem for Linux (Ubuntu) Installation Guide
](https://github.com/oobabooga/text-generation-webui/wiki/Windows-Subsystem-for-Linux-(Ubuntu)-Installation-Guide).
> 2. For a more detailed, user-contributed guide, see: [Installation instructions for human beings](https://github.com/oobabooga/text-generation-webui/wiki/Installation-instructions-for-human-beings).
## Installation option 2: one-click installers
Expand Down
1 change: 1 addition & 0 deletions extensions/api/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flask_cloudflared==0.0.12
10 changes: 9 additions & 1 deletion extensions/api/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,15 @@ def do_POST(self):
def run_server():
server_addr = ('0.0.0.0' if shared.args.listen else '127.0.0.1', params['port'])
server = ThreadingHTTPServer(server_addr, Handler)
print(f'Starting KoboldAI compatible api at http://{server_addr[0]}:{server_addr[1]}/api')
if shared.args.share:
try:
from flask_cloudflared import _run_cloudflared
public_url = _run_cloudflared(params['port'], params['port'] + 1)
print(f'Starting KoboldAI compatible api at {public_url}/api')
except ImportError:
print('You should install flask_cloudflared manually')
else:
print(f'Starting KoboldAI compatible api at http://{server_addr[0]}:{server_addr[1]}/api')
server.serve_forever()

def ui():
Expand Down

0 comments on commit b501722

Please sign in to comment.