Spaces:
Sleeping
Sleeping
XufengDuan
commited on
Commit
•
05052dc
1
Parent(s):
8588482
update scripts
Browse files
src/backend/model_operations.py
CHANGED
@@ -35,11 +35,15 @@ import subprocess
|
|
35 |
|
36 |
# Run the command to download the spaCy model
|
37 |
subprocess.run(["python", "-m", "spacy", "download", "en_core_web_trf"], check=True)
|
38 |
-
subprocess.run(["pip", "install", "spacy-transformers"], check=True)
|
39 |
subprocess.run(["pip", "install", "curated-transformers==0.1.1"], check=True)
|
40 |
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
43 |
|
44 |
# litellm.set_verbose=False
|
45 |
litellm.set_verbose=True
|
@@ -47,14 +51,7 @@ litellm.set_verbose=True
|
|
47 |
logging.basicConfig(level=logging.INFO,
|
48 |
format='%(asctime)s - %(levelname)s - %(message)s')
|
49 |
|
50 |
-
|
51 |
-
# nlp = spacy.load("en_core_web_sm")
|
52 |
-
try:
|
53 |
-
nlp1 = spacy.load("en_core_web_trf")
|
54 |
-
except OSError:
|
55 |
-
print("Downloading language model for the spaCy 'en_core_web_trf'...")
|
56 |
-
spacy.cli.download("en_core_web_trf")
|
57 |
-
nlp = spacy.load("en_core_web_trf")
|
58 |
|
59 |
# os.environ["HUGGINGFACE_API_KEY"] = envs.TOKEN
|
60 |
|
|
|
35 |
|
36 |
# Run the command to download the spaCy model
|
37 |
subprocess.run(["python", "-m", "spacy", "download", "en_core_web_trf"], check=True)
|
38 |
+
# subprocess.run(["pip", "install", "spacy-transformers"], check=True)
|
39 |
subprocess.run(["pip", "install", "curated-transformers==0.1.1"], check=True)
|
40 |
|
41 |
+
# Load spacy model for word tokenization
|
42 |
+
# nlp = spacy.load("en_core_web_sm")
|
43 |
+
try:
|
44 |
+
nlp1 = spacy.load("en_core_web_trf")
|
45 |
+
except OSError:
|
46 |
+
pass
|
47 |
|
48 |
# litellm.set_verbose=False
|
49 |
litellm.set_verbose=True
|
|
|
51 |
logging.basicConfig(level=logging.INFO,
|
52 |
format='%(asctime)s - %(levelname)s - %(message)s')
|
53 |
|
54 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
# os.environ["HUGGINGFACE_API_KEY"] = envs.TOKEN
|
57 |
|