Skip to content

Commit a772f50

Browse files
Merge pull request #1109 from dagleaves/fix/local-workflow-file-not-found
Fix local workflow file not found error
2 parents 295ca68 + 10392cc commit a772f50

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

inference/core/roboflow_api.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55
import urllib.parse
66
from enum import Enum
7+
from hashlib import sha256
78
from pathlib import Path
89
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
910

@@ -555,8 +556,9 @@ def get_workflow_specification(
555556
if not re.match(r"^[\w\-]+$", workflow_id):
556557
raise ValueError("Invalid workflow id")
557558

559+
workflow_hash = sha256(workflow_id.encode()).hexdigest()
558560
local_file_path = (
559-
Path(MODEL_CACHE_DIR) / "workflow" / "local" / f"{workflow_id}.json"
561+
Path(MODEL_CACHE_DIR) / "workflow" / "local" / f"{workflow_hash}.json"
560562
)
561563
if not local_file_path.exists():
562564
raise FileNotFoundError(f"Local workflow file not found: {local_file_path}")

0 commit comments

Comments
 (0)