Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -15,9 +15,11 @@ checkpoints = [
|
|
15 |
]
|
16 |
|
17 |
|
18 |
-
@st.cache
|
19 |
def download_spacy_model(model="en"):
|
20 |
-
|
|
|
|
|
|
|
21 |
return True
|
22 |
|
23 |
|
|
|
15 |
]
|
16 |
|
17 |
|
|
|
18 |
def download_spacy_model(model="en"):
|
19 |
+
try:
|
20 |
+
spacy.load(model)
|
21 |
+
except ImportError:
|
22 |
+
spacy.cli.download(model) # type: ignore
|
23 |
return True
|
24 |
|
25 |
|