Spaces:
Paused
Paused
Download utils.py from JatinAutonomousLabs/SPOC_V1: direct link, hf CLI and curl.
- Browser
- Download file 439 Bytes
-
https://huggingface.co/spaces/JatinAutonomousLabs/SPOC_V1/resolve/main/utils.py
- Command line
-
hf download hf://spaces/JatinAutonomousLabs/SPOC_V1/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/JatinAutonomousLabs/SPOC_V1/resolve/main/utils.py
439 Bytes
| def generate_mermaid_diagram(path: list) -> str: | |
| """Generates Mermaid.js syntax for the execution path.""" | |
| if not path: | |
| return "" | |
| diagram = "graph TD;\n" | |
| # Replace spaces with underscores for valid Mermaid node names | |
| path_nodes = [p.replace(' ', '_') for p in path] | |
| for i in range(len(path_nodes) - 1): | |
| diagram += f" {path_nodes[i]} --> {path_nodes[i+1]};\n" | |
| return diagram |