Spaces:
Sleeping
Sleeping
Download utils/translator.py from PRUTHVIn/vqa_project: direct link, hf CLI and curl.
- Browser
- Download file 171 Bytes
-
https://huggingface.co/spaces/PRUTHVIn/vqa_project/resolve/main/utils/translator.py
- Command line
-
hf download hf://spaces/PRUTHVIn/vqa_project/utils/translator.py
-
curl -L -o translator.py https://huggingface.co/spaces/PRUTHVIn/vqa_project/resolve/main/utils/translator.py
171 Bytes
| from langdetect import detect | |
| def detect_lang(text): | |
| try: | |
| return detect(text) | |
| except: | |
| return "en" | |
| def translate(text, src, tgt): | |
| return text | |