Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,13 +7,13 @@ import subprocess
|
|
| 7 |
|
| 8 |
# Run the spacy model download command
|
| 9 |
|
| 10 |
-
try:
|
| 11 |
# Try to load the model to check if it's already installed
|
| 12 |
-
nlp = spacy.load("en_core_web_trf")
|
| 13 |
-
except OSError:
|
| 14 |
# If the model is not found, download it
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
model = SentenceTransformer("nomic-ai/nomic-embed-text-v1", trust_remote_code=True)
|
| 19 |
|
|
|
|
| 7 |
|
| 8 |
# Run the spacy model download command
|
| 9 |
|
| 10 |
+
# try:
|
| 11 |
# Try to load the model to check if it's already installed
|
| 12 |
+
# nlp = spacy.load("en_core_web_trf")
|
| 13 |
+
# except OSError:
|
| 14 |
# If the model is not found, download it
|
| 15 |
+
subprocess.run(["python", "-m", "spacy", "download", "en_core_web_trf"])
|
| 16 |
+
nlp = spacy.load("en_core_web_trf")
|
| 17 |
|
| 18 |
model = SentenceTransformer("nomic-ai/nomic-embed-text-v1", trust_remote_code=True)
|
| 19 |
|