Spaces:
Sleeping
Sleeping
salomonsky
commited on
Commit
•
aa36e88
1
Parent(s):
288bd15
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
#!/usr/bin/env python
|
2 |
-
|
3 |
from __future__ import annotations
|
4 |
import os
|
5 |
import gradio as gr
|
@@ -10,15 +9,21 @@ from app_upload import create_upload_demo
|
|
10 |
from inference import InferencePipeline
|
11 |
from trainer import Trainer
|
12 |
|
13 |
-
TITLE = '
|
14 |
-
|
15 |
ORIGINAL_SPACE_ID = 'lora-library/LoRA-DreamBooth-Training-UI'
|
16 |
SPACE_ID = os.getenv('SPACE_ID', ORIGINAL_SPACE_ID)
|
|
|
|
|
17 |
|
18 |
if os.getenv('SYSTEM') == 'spaces' and SPACE_ID != ORIGINAL_SPACE_ID:
|
19 |
SETTINGS = f'<a href="https://huggingface.co/spaces/{SPACE_ID}/settings">Settings</a>'
|
20 |
else:
|
21 |
SETTINGS = 'Settings'
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
24 |
|
@@ -47,6 +52,9 @@ with gr.Blocks(css='style.css') as demo:
|
|
47 |
with gr.TabItem('Test'):
|
48 |
create_inference_demo(pipe, HF_TOKEN)
|
49 |
with gr.TabItem('Upload'):
|
|
|
|
|
|
|
50 |
create_upload_demo(HF_TOKEN)
|
51 |
|
52 |
demo.queue(max_size=1).launch(share=False)
|
|
|
1 |
#!/usr/bin/env python
|
|
|
2 |
from __future__ import annotations
|
3 |
import os
|
4 |
import gradio as gr
|
|
|
9 |
from inference import InferencePipeline
|
10 |
from trainer import Trainer
|
11 |
|
12 |
+
TITLE = '# LoRA DreamBooth Training UI'
|
|
|
13 |
ORIGINAL_SPACE_ID = 'lora-library/LoRA-DreamBooth-Training-UI'
|
14 |
SPACE_ID = os.getenv('SPACE_ID', ORIGINAL_SPACE_ID)
|
15 |
+
SHARED_UI_WARNING = f'''
|
16 |
+
'''
|
17 |
|
18 |
if os.getenv('SYSTEM') == 'spaces' and SPACE_ID != ORIGINAL_SPACE_ID:
|
19 |
SETTINGS = f'<a href="https://huggingface.co/spaces/{SPACE_ID}/settings">Settings</a>'
|
20 |
else:
|
21 |
SETTINGS = 'Settings'
|
22 |
+
CUDA_NOT_AVAILABLE_WARNING = f'''
|
23 |
+
'''
|
24 |
+
|
25 |
+
HF_TOKEN_NOT_SPECIFIED_WARNING = f'''
|
26 |
+
'''
|
27 |
|
28 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
29 |
|
|
|
52 |
with gr.TabItem('Test'):
|
53 |
create_inference_demo(pipe, HF_TOKEN)
|
54 |
with gr.TabItem('Upload'):
|
55 |
+
gr.Markdown('''
|
56 |
+
- You can use this tab to upload models later if you choose not to upload models in training time or if upload in training time failed.
|
57 |
+
''')
|
58 |
create_upload_demo(HF_TOKEN)
|
59 |
|
60 |
demo.queue(max_size=1).launch(share=False)
|