Download engine/explainability/explain.py from jash-ai/divya: direct link, hf CLI and curl.
- Browser
- Download file 249 Bytes
-
https://huggingface.co/spaces/jash-ai/divya/resolve/main/engine/explainability/explain.py
- Command line
-
hf download hf://spaces/jash-ai/divya/engine/explainability/explain.py
-
curl -L -o explain.py https://huggingface.co/spaces/jash-ai/divya/resolve/main/engine/explainability/explain.py
249 Bytes
| def explain(cat,action,attacks,phi): | |
| return { | |
| "decision_trace":[ | |
| f"Category: {cat}", | |
| f"Action: {action}", | |
| f"Triggered: {[k for k,v in attacks.items() if v]}", | |
| f"PHI: {phi}" | |
| ] | |
| } | |