Spaces:
Sleeping
Sleeping
Download utils.py from negi2725/LegalApiBackendService: direct link, hf CLI and curl.
- Browser
- Download file 249 Bytes
-
https://huggingface.co/spaces/negi2725/LegalApiBackendService/resolve/main/utils.py
- Command line
-
hf download hf://spaces/negi2725/LegalApiBackendService/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/negi2725/LegalApiBackendService/resolve/main/utils.py
249 Bytes
| import json | |
| def chunkToText(chunk): | |
| if isinstance(chunk, str): | |
| return chunk | |
| if isinstance(chunk, dict): | |
| return chunk.get("text") or chunk.get("description") or chunk.get("content") or json.dumps(chunk) | |
| return str(chunk) | |