Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,8 @@ from typing import Union
|
|
4 |
is_spaces = True if os.environ.get("SPACE_ID") else False
|
5 |
|
6 |
if is_spaces:
|
7 |
-
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
8 |
import spaces
|
9 |
-
|
10 |
|
11 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
12 |
import sys
|
@@ -330,12 +329,6 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
330 |
```bash
|
331 |
git clone https://huggingface.co/spaces/flux-train/flux-lora-trainer
|
332 |
cd flux-lora-trainer
|
333 |
-
## Optional, start a venv environment ##
|
334 |
-
python3 -m venv venv
|
335 |
-
source venv/bin/activate
|
336 |
-
# .\venv\Scripts\activate on windows
|
337 |
-
# install torch first
|
338 |
-
## End of optional ##
|
339 |
pip install requirements_local.txt
|
340 |
```
|
341 |
|
@@ -344,6 +337,10 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
344 |
git clone https://github.com/ostris/ai-toolkit.git
|
345 |
cd ai-toolkit
|
346 |
git submodule update --init --recursive
|
|
|
|
|
|
|
|
|
347 |
pip3 install torch
|
348 |
pip3 install -r requirements.txt
|
349 |
cd ..
|
@@ -354,11 +351,10 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
354 |
huggingface-cli login
|
355 |
```
|
356 |
|
357 |
-
Now you can run FLUX LoRA Ease locally
|
358 |
```py
|
359 |
python app.py
|
360 |
```
|
361 |
-
|
362 |
If you prefer command line, you can run Ostris' [AI Toolkit](https://github.com/ostris/ai-toolkit) yourself directly.
|
363 |
"""
|
364 |
)
|
|
|
4 |
is_spaces = True if os.environ.get("SPACE_ID") else False
|
5 |
|
6 |
if is_spaces:
|
|
|
7 |
import spaces
|
8 |
+
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
9 |
|
10 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
11 |
import sys
|
|
|
329 |
```bash
|
330 |
git clone https://huggingface.co/spaces/flux-train/flux-lora-trainer
|
331 |
cd flux-lora-trainer
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
pip install requirements_local.txt
|
333 |
```
|
334 |
|
|
|
337 |
git clone https://github.com/ostris/ai-toolkit.git
|
338 |
cd ai-toolkit
|
339 |
git submodule update --init --recursive
|
340 |
+
python3 -m venv venv
|
341 |
+
source venv/bin/activate
|
342 |
+
# .\venv\Scripts\activate on windows
|
343 |
+
# install torch first
|
344 |
pip3 install torch
|
345 |
pip3 install -r requirements.txt
|
346 |
cd ..
|
|
|
351 |
huggingface-cli login
|
352 |
```
|
353 |
|
354 |
+
Now you can run FLUX LoRA Ease locally by doing a simple
|
355 |
```py
|
356 |
python app.py
|
357 |
```
|
|
|
358 |
If you prefer command line, you can run Ostris' [AI Toolkit](https://github.com/ostris/ai-toolkit) yourself directly.
|
359 |
"""
|
360 |
)
|