Spaces:
Running
on
Zero
Running
on
Zero
salma-remyx
commited on
Commit
·
174e0c6
1
Parent(s):
a8b0636
add spacy download
Browse files
app.py
CHANGED
@@ -29,6 +29,14 @@ from vqasynth.prompts import PromptGenerator
|
|
29 |
import numpy as np
|
30 |
import gradio as gr
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
depth = DepthEstimator(from_onnx=False)
|
33 |
localizer = Localizer()
|
34 |
spatial_scene_constructor = SpatialSceneConstructor()
|
|
|
29 |
import numpy as np
|
30 |
import gradio as gr
|
31 |
|
32 |
+
try:
|
33 |
+
nlp = spacy.load("en_core_web_sm")
|
34 |
+
except OSError:
|
35 |
+
# Download the model if it's not already available
|
36 |
+
from spacy.cli import download
|
37 |
+
download("en_core_web_sm")
|
38 |
+
nlp = spacy.load("en_core_web_sm")
|
39 |
+
|
40 |
depth = DepthEstimator(from_onnx=False)
|
41 |
localizer = Localizer()
|
42 |
spatial_scene_constructor = SpatialSceneConstructor()
|