Commit
·
56e7e9c
1
Parent(s):
aba0837
global_MRT declared before use
Browse files
app.py
CHANGED
@@ -1001,6 +1001,7 @@ class ModelSelect(BaseModel):
|
|
1001 |
@app.post("/model/select")
|
1002 |
def model_select(req: ModelSelect):
|
1003 |
# --- Current env defaults ---
|
|
|
1004 |
cur = {
|
1005 |
"size": os.getenv("MRT_SIZE", "large"),
|
1006 |
"repo": os.getenv("MRT_CKPT_REPO"),
|
@@ -1050,7 +1051,7 @@ def model_select(req: ModelSelect):
|
|
1050 |
os.environ["MRT_SIZE"] = str(tgt["size"])
|
1051 |
|
1052 |
# Rebuild model and optionally prewarm
|
1053 |
-
|
1054 |
with _MRT_LOCK:
|
1055 |
_MRT = None
|
1056 |
if req.prewarm:
|
@@ -1122,7 +1123,7 @@ def model_select(req: ModelSelect):
|
|
1122 |
os.environ["MRT_ASSETS_REPO"] = str(tgt["assets"])
|
1123 |
|
1124 |
# force rebuild
|
1125 |
-
|
1126 |
with _MRT_LOCK:
|
1127 |
_MRT = None
|
1128 |
|
|
|
1001 |
@app.post("/model/select")
|
1002 |
def model_select(req: ModelSelect):
|
1003 |
# --- Current env defaults ---
|
1004 |
+
global_MRT
|
1005 |
cur = {
|
1006 |
"size": os.getenv("MRT_SIZE", "large"),
|
1007 |
"repo": os.getenv("MRT_CKPT_REPO"),
|
|
|
1051 |
os.environ["MRT_SIZE"] = str(tgt["size"])
|
1052 |
|
1053 |
# Rebuild model and optionally prewarm
|
1054 |
+
|
1055 |
with _MRT_LOCK:
|
1056 |
_MRT = None
|
1057 |
if req.prewarm:
|
|
|
1123 |
os.environ["MRT_ASSETS_REPO"] = str(tgt["assets"])
|
1124 |
|
1125 |
# force rebuild
|
1126 |
+
|
1127 |
with _MRT_LOCK:
|
1128 |
_MRT = None
|
1129 |
|