Spaces:
Sleeping
Sleeping
Download utils.py from ryanRocks/FalconOpenAI: direct link, hf CLI and curl.
- Browser
- Download file 522 Bytes
-
https://huggingface.co/spaces/ryanRocks/FalconOpenAI/resolve/main/utils.py
- Command line
-
hf download hf://spaces/ryanRocks/FalconOpenAI/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/ryanRocks/FalconOpenAI/resolve/main/utils.py
522 Bytes
| import json | |
| def load_embeddings(filename): | |
| ''' | |
| Load embeddings from specified json file | |
| Args: | |
| filename: Name of the json file to load embeddings from | |
| Returns: | |
| List of embeddings loaded from the file | |
| ''' | |
| print("Loading embeddings...") | |
| with open(filename, 'r') as file: | |
| embeddings = json.load(file) | |
| return embeddings | |
| DOC_CHUNK_SIZE = 1000 | |
| DOC_CHUNK_OVERLAP = 40 | |
| DOC_DIRECTORY = './' | |
| EMBEDDING_FILE = 'embeddings.json' | |
| BATCH_SIZE = 100 | |
| INDEX_NAME = "project-falcon" |