Spaces:
Paused
Paused
added API_MODE flag in async_worker to prevent loading models when in API_MODE - 2
Browse files- modules/async_worker.py +4 -5
modules/async_worker.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
import threading
|
2 |
import re
|
3 |
|
|
|
|
|
|
|
|
|
4 |
args = ini_args()
|
5 |
if not args.api_mode:
|
6 |
from modules.patch import PatchSettings, patch_settings, patch_all
|
@@ -18,14 +22,9 @@ class AsyncTask:
|
|
18 |
|
19 |
async_tasks = []
|
20 |
|
21 |
-
def ini_args():
|
22 |
-
from args_manager import args
|
23 |
-
return args
|
24 |
-
|
25 |
def worker():
|
26 |
global async_tasks
|
27 |
|
28 |
-
args = ini_args()
|
29 |
if args.api_mode:
|
30 |
return
|
31 |
|
|
|
1 |
import threading
|
2 |
import re
|
3 |
|
4 |
+
def ini_args():
|
5 |
+
from args_manager import args
|
6 |
+
return args
|
7 |
+
|
8 |
args = ini_args()
|
9 |
if not args.api_mode:
|
10 |
from modules.patch import PatchSettings, patch_settings, patch_all
|
|
|
22 |
|
23 |
async_tasks = []
|
24 |
|
|
|
|
|
|
|
|
|
25 |
def worker():
|
26 |
global async_tasks
|
27 |
|
|
|
28 |
if args.api_mode:
|
29 |
return
|
30 |
|