Spaces:
Running on Zero
Running on Zero
Download tests/test_app_gpu_boundary.py from junaid-simamdigital/Simam3D-GPU: direct link, hf CLI and curl.
- Browser
- Download file 825 Bytes
-
https://huggingface.co/spaces/junaid-simamdigital/Simam3D-GPU/resolve/main/tests/test_app_gpu_boundary.py
- Command line
-
hf download hf://spaces/junaid-simamdigital/Simam3D-GPU/tests/test_app_gpu_boundary.py
-
curl -L -o test_app_gpu_boundary.py https://huggingface.co/spaces/junaid-simamdigital/Simam3D-GPU/resolve/main/tests/test_app_gpu_boundary.py
825 Bytes
| import ast | |
| from pathlib import Path | |
| def test_deterministic_export_bypasses_gpu_wrapper(tmp_path): | |
| source = (Path(tmp_path) / "app.py").read_text(encoding="utf-8") if (Path(tmp_path) / "app.py").exists() else Path("app.py").read_text(encoding="utf-8") | |
| tree = ast.parse(source) | |
| functions = {node.name: node for node in tree.body if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef))} | |
| assert "_generate_impl" in functions | |
| assert "_generate_gpu" in functions | |
| assert "generate" in functions | |
| gpu = functions["_generate_gpu"] | |
| assert any(isinstance(dec, ast.Name) and dec.id == "GPU_FUNCTION" for dec in gpu.decorator_list) | |
| public = functions["generate"] | |
| assert any(isinstance(node, ast.If) and isinstance(node.test, ast.Name) and node.test.id == "demo_mode" for node in public.body) | |