Spaces:
Runtime error
Runtime error
Download aa.py from hyo37009/talkWithME: direct link, hf CLI and curl.
- Browser
- Download file 464 Bytes
-
https://huggingface.co/spaces/hyo37009/talkWithME/resolve/main/aa.py
- Command line
-
hf download hf://spaces/hyo37009/talkWithME/aa.py
-
curl -L -o aa.py https://huggingface.co/spaces/hyo37009/talkWithME/resolve/main/aa.py
464 Bytes
| docs = open("sample.pdf", "r") | |
| doc_list = [] | |
| for file in docs: | |
| print('file - type : ', file.type) | |
| if file.type == 'text/plain': | |
| # file is .txt | |
| print("txt") | |
| elif file.type in ['application/octet-stream', 'application/pdf']: | |
| # file is .pdf | |
| print("pdf") | |
| elif file.type == 'text/csv': | |
| # file is .csv | |
| print("csv") | |
| elif file.type == 'application/json': | |
| # file is .json | |
| print("json") | |