Spaces:
Sleeping
Sleeping
Upload scripts/run.py with huggingface_hub
Browse files- scripts/run.py +16 -0
scripts/run.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sys
|
2 |
+
sys.path.append(sys.path[0].replace('scripts', ''))
|
3 |
+
import os
|
4 |
+
|
5 |
+
from scripts.prompt_engine import PromptSearchEngine
|
6 |
+
import argparse
|
7 |
+
from config.data_paths import PROCESSED_DATA_PATH
|
8 |
+
from scripts.preprocess import clean_corpus
|
9 |
+
from scripts.utils import load_config
|
10 |
+
|
11 |
+
config = load_config()
|
12 |
+
clean_corpus()
|
13 |
+
search_engine = PromptSearchEngine(corpus=os.path.join(PROCESSED_DATA_PATH, 'prompt_corpus_clean.parquet'),
|
14 |
+
model_name=config['search_engine']['model_name'],
|
15 |
+
use_index=config['search_engine']['use_index'])
|
16 |
+
|