Skip to content

Commit

Permalink
Merge pull request #903 from Capsize-Games/devastator
Browse files Browse the repository at this point in the history
Devastator
  • Loading branch information
w4ffl35 authored Oct 8, 2024
2 parents e83bda0 + 534a6e5 commit aef2aeb
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 638 deletions.
Binary file removed .coverage
Binary file not shown.
5 changes: 0 additions & 5 deletions .dockerignore

This file was deleted.

119 changes: 28 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,83 +92,59 @@ large language models (LLM) and AI image generators (Stable Diffusion) on your o

### Linux

1. Open your file explorer and navigate to the directory containing the `install.sh` script
2. Open the terminal using the keyboard shortcut `Ctrl + Alt + T`
3. Drag the `install.sh` script into the terminal and press `Enter`
4. Follow the on-screen instructions

---

## 🚀 Running AI Runner

### Linux

1. Open the terminal using the keyboard shortcut `Ctrl + Alt + T`
2. Navigate to the directory containing the `run.sh` script (`cd ~/airunner` for example)
3. Run the `bin/run.sh` script by typing `./bin/run.sh` and pressing `Enter`
4. AI Runner will start and you can begin using it after following the on-screen setup instructions

---

## ✏️ Using AI Runner

[Instructions on how to use AI Runner can be found in the wiki](https://github.com/Capsize-Games/airunner/wiki/AI-Runner)


---

## 💾 Compiling AI Runner

Clone this repository
Install prerequisites

```bash
git clone https://github.com/Capsize-Games/airunner.git
cd airunner
sudo apt update
sudo apt install -y fonts-noto-color-emoji
sudo apt install -y libportaudio2
sudo apt install -y libxcb-cursor0
sudo apt install -y espeak
sudo apt install -y xclip
sudo apt install -y git
sudo apt install -y python3-pip
sudo apt install -y python3.10-venv
```

### Build from source
Clone the repository

```bash
pip install -e .
pip install pyinstaller
bash build.dev.sh
git clone https://github.com/Capsize-Games/airunner.git
cd airunner
```

## 🔬 Unit tests
Create a virtual environment

Run a specific test
```bash
python -m unittest src/airunner/tests/test_draggable_pixmap.py
python3 -m venv airunner
source airunner/bin/activate
```

Test coverage is currently low, but the existing tests can be run using the following command:
Install AI Runner

```bash
python -m unittest discover tests
pip install -e .
```

### Test coverage
---

Run tests with coverage tracking:
## 🚀 Running AI Runner

```bash
coverage run --source=src/airunner --omit=__init__.py,*/data/*,*/tests/*,*_ui.py,*/enums.py,*/settings.py -m unittest discover src/airunner/tests
```
### Linux

To see a report in the terminal, use:
Activate the virtual environment

```bash
coverage report
source airunner/bin/activate
```

For a more detailed HTML report, run:
Run AI Runner

```bash
coverage html
cd airunner/src/airunner
./main.py
```

View results in `htmlcov/index.html`.

---

### Privacy and Security
Expand All @@ -179,18 +155,11 @@ care to strip the application of any telemetry or tracking features.
The main application itself is unable to access the internet, and we are working
towards properly sandboxing certain features to ensure user privacy and security.

As this application evolves we will migrate away from the Huggingface libraries.
---

### Internet access

The core application is incapable of accessing the internet. However there are two features which require
internet access. These two features are the `setup wizard` and the `model manager`.

Each of these tools are isolated in their own application windows
which are capable of directly accessing and downloading files on Huggingface.co and
civitai.com (depending on the given URL). Any other URL will be blocked.

The Huggingface Hub library is not used to access these downloads.
Only the setup wizard needs access to the internet in order to download the required models.

For more information see the [Darklock](https://github.com/capsize-games/darklock) and
[Facehuggershield](https://github.com/capsize-games/facehuggershield) libraries.
Expand Down Expand Up @@ -225,35 +194,3 @@ The security measures taken for this library are as follows
- All telemetry disabled

See [Facehuggershield](https://github.com/capsize-games/facehuggershield) for more information.

---

#### Planned security measures for Huggingface Libraries

We plant o remove the Huggingface libraries from the application in the future.
Although the architecture is currently dependent on these libraries, we will
migrate to a better solution in the future.

---

## Improving performance

To profile various functions in an effort to improve performance, you can install `line_profiler`

```bash
pip install line_profiler
```

To profile a function, add the `@profile` decorator to the function you wish to profile.

Then run the following command:

```bash
kernprof -l -v main.py
```

To view the results after

```bash
python display_profile_data.py
```
Loading

0 comments on commit aef2aeb

Please sign in to comment.