Spaces:
Sleeping
Sleeping
Update api_server.py
Browse files- api_server.py +2 -2
api_server.py
CHANGED
@@ -25,8 +25,8 @@ if load_type == 'local':
|
|
25 |
model_path = f'{MODEL_DIR}/{MODEL_NAME}'
|
26 |
if not os.path.exists(model_path):
|
27 |
raise FileNotFoundError(f"Model file not found at {model_path}")
|
28 |
-
|
29 |
-
model =
|
30 |
model.eval() # 設定模型為推理模式
|
31 |
elif load_type == 'remote_hub_download':
|
32 |
from huggingface_hub import hf_hub_download
|
|
|
25 |
model_path = f'{MODEL_DIR}/{MODEL_NAME}'
|
26 |
if not os.path.exists(model_path):
|
27 |
raise FileNotFoundError(f"Model file not found at {model_path}")
|
28 |
+
|
29 |
+
model = YOLO(model_path)
|
30 |
model.eval() # 設定模型為推理模式
|
31 |
elif load_type == 'remote_hub_download':
|
32 |
from huggingface_hub import hf_hub_download
|