Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional code to use a local copy of marked and ensure interface can run offline #52

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ build/
__pycache__/
.idea
venv
dist
dist
static/node_modules/
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ cd exui
pip install -r requirements.txt
```

Optionally, install javascript modules locally, to enable the UI to run when offline (requires Node and npm to be installed):
```
cd static
npm install
cd ..
```

Then run the web server with the included server.py:

```
Expand All @@ -43,7 +50,7 @@ python server.py
Your browser should automatically open on the default IP/port. Config and sessions are stored in `~/exui` by default.

Prebuilt wheels for ExLlamaV2 are available [here](https://github.com/turboderp/exllamav2/releases). Installing
the latest version of [Flash Attention](https://github.com/Dao-AILab/flash-attention) is recommended.
the latest version of [Flash Attention](https://github.com/Dao-AILab/flash-attention) is recommended.

### Running in Google Colab

Expand Down
25 changes: 25 additions & 0 deletions static/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "exui",
"version": "1.0.0",
"description": "<p align=\"center\">",
"main": "index.js",
"directories": {
"doc": "doc"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/turboderp/exui.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/turboderp/exui/issues"
},
"homepage": "https://github.com/turboderp/exui#readme",
"dependencies": {
"marked": "^12.0.2"
}
}
5 changes: 4 additions & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
{% include 'svg_icons.html' %}
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="static/node_modules/marked/marked.min.js"></script>
<script>
typeof marked != "undefined" || document.write('<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"><\/script>');
</script>
<script type="module" src="{{ url_for('static', filename='util.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='roles.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='globals.js') }}"></script>
Expand Down