Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,14 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from gramformer import Gramformer
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
# Initialize the Gramformer model (using default settings for now)
|
5 |
gf = Gramformer(models=1, use_gpu=False)
|
6 |
|
|
|
1 |
+
import subprocess
|
2 |
+
import spacy
|
3 |
import gradio as gr
|
4 |
from gramformer import Gramformer
|
5 |
|
6 |
+
# Check if the 'en_core_web_sm' model is installed, if not, install it
|
7 |
+
try:
|
8 |
+
spacy.load("en_core_web_sm")
|
9 |
+
except OSError:
|
10 |
+
subprocess.run(["python", "-m", "spacy", "download", "en_core_web_sm"])
|
11 |
+
|
12 |
# Initialize the Gramformer model (using default settings for now)
|
13 |
gf = Gramformer(models=1, use_gpu=False)
|
14 |
|