Download src/openfactcheck/lib/utils.py from hasaniqbal777/OpenFactCheck-Prerelease: direct link, hf CLI and curl.
- Browser
- Download file 326 Bytes
-
https://huggingface.co/spaces/hasaniqbal777/OpenFactCheck-Prerelease/resolve/main/src/openfactcheck/lib/utils.py
- Command line
-
hf download hf://spaces/hasaniqbal777/OpenFactCheck-Prerelease/src/openfactcheck/lib/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/hasaniqbal777/OpenFactCheck-Prerelease/resolve/main/src/openfactcheck/lib/utils.py
326 Bytes
| def detect_streamlit() -> bool: | |
| try: | |
| from streamlit.runtime.scriptrunner import get_script_run_ctx | |
| if get_script_run_ctx() is not None: | |
| return True | |
| else: | |
| return False | |
| except ImportError: | |
| return False | |
| except Exception: | |
| return False | |