Spaces:
Runtime error
Runtime error
Download processing/text.py from zej97/AI-Research-Assistant: direct link, hf CLI and curl.
- Browser
- Download file 392 Bytes
-
https://huggingface.co/spaces/zej97/AI-Research-Assistant/resolve/main/processing/text.py
- Command line
-
hf download hf://spaces/zej97/AI-Research-Assistant/processing/text.py
-
curl -L -o text.py https://huggingface.co/spaces/zej97/AI-Research-Assistant/resolve/main/processing/text.py
392 Bytes
| """Text processing functions""" | |
| from typing import Dict, Generator | |
| from config import Config | |
| import os | |
| CFG = Config() | |
| def read_txt_files(directory): | |
| all_text = '' | |
| for filename in os.listdir(directory): | |
| if filename.endswith('.txt'): | |
| with open(os.path.join(directory, filename), 'r') as file: | |
| all_text += file.read() + '\n' | |
| return all_text | |