Update app.py
Browse files
app.py
CHANGED
@@ -151,6 +151,8 @@ def load_models_and_documents():
|
|
151 |
data_dir = os.path.join(os.getenv('HF_HOME'), 'nltk_data')
|
152 |
os.makedirs(os.path.join(data_dir, 'taggers'), exist_ok=True)
|
153 |
os.makedirs(os.path.join(data_dir, 'tokenizers'), exist_ok=True)
|
|
|
|
|
154 |
|
155 |
tagger_path = nltk.data.find('taggers/averaged_perceptron_tagger/averaged_perceptron_tagger.pickle')
|
156 |
with open(os.path.join(data_dir, 'taggers', 'averaged_perceptron_tagger.pickle'), 'wb') as f:
|
@@ -159,8 +161,6 @@ def load_models_and_documents():
|
|
159 |
punkt_path = nltk.data.find('tokenizers/punkt/english.pickle')
|
160 |
with open(os.path.join(data_dir, 'tokenizers', 'punkt.pickle'), 'wb') as f:
|
161 |
f.write(open(punkt_path, 'rb').read())
|
162 |
-
|
163 |
-
nltk.data.path.append(data_dir)
|
164 |
|
165 |
client = QdrantClient(':memory:')
|
166 |
collection_name = 'collection_demo'
|
|
|
151 |
data_dir = os.path.join(os.getenv('HF_HOME'), 'nltk_data')
|
152 |
os.makedirs(os.path.join(data_dir, 'taggers'), exist_ok=True)
|
153 |
os.makedirs(os.path.join(data_dir, 'tokenizers'), exist_ok=True)
|
154 |
+
|
155 |
+
nltk.data.path.append(data_dir)
|
156 |
|
157 |
tagger_path = nltk.data.find('taggers/averaged_perceptron_tagger/averaged_perceptron_tagger.pickle')
|
158 |
with open(os.path.join(data_dir, 'taggers', 'averaged_perceptron_tagger.pickle'), 'wb') as f:
|
|
|
161 |
punkt_path = nltk.data.find('tokenizers/punkt/english.pickle')
|
162 |
with open(os.path.join(data_dir, 'tokenizers', 'punkt.pickle'), 'wb') as f:
|
163 |
f.write(open(punkt_path, 'rb').read())
|
|
|
|
|
164 |
|
165 |
client = QdrantClient(':memory:')
|
166 |
collection_name = 'collection_demo'
|