devcom33
commited on
Commit
·
db36e68
1
Parent(s):
edd3265
fix libs issues
Browse files- models.py +7 -2
- requirements.txt +2 -1
models.py
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
-
from huggingface_hub import snapshot_download
|
2 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import spacy
|
4 |
import logging
|
5 |
from faster_whisper import WhisperModel
|
@@ -38,7 +43,7 @@ def load_whisper(config):
|
|
38 |
def load_summarizer(config):
|
39 |
logger.info("Loading Summarization pipeline...")
|
40 |
try:
|
41 |
-
summarizer = pipeline("summarization", model=config.SUMMARIZER_MODEL)
|
42 |
logger.info("Summarization pipeline loaded.")
|
43 |
return summarizer
|
44 |
except Exception as e:
|
|
|
|
|
1 |
import os
|
2 |
+
os.environ['HF_HOME'] = '/tmp/huggingface'
|
3 |
+
os.environ['TRANSFORMERS_CACHE'] = '/tmp/huggingface'
|
4 |
+
|
5 |
+
os.environ['HUGGINGFACE_HUB_CACHE'] = '/tmp/huggingface'
|
6 |
+
|
7 |
+
from huggingface_hub import snapshot_download
|
8 |
import spacy
|
9 |
import logging
|
10 |
from faster_whisper import WhisperModel
|
|
|
43 |
def load_summarizer(config):
|
44 |
logger.info("Loading Summarization pipeline...")
|
45 |
try:
|
46 |
+
summarizer = pipeline("summarization", model=config.SUMMARIZER_MODEL, from_tf=True)
|
47 |
logger.info("Summarization pipeline loaded.")
|
48 |
return summarizer
|
49 |
except Exception as e:
|
requirements.txt
CHANGED
@@ -6,4 +6,5 @@ faster_whisper
|
|
6 |
spacy
|
7 |
pydub
|
8 |
psutil
|
9 |
-
python-multipart
|
|
|
|
6 |
spacy
|
7 |
pydub
|
8 |
psutil
|
9 |
+
python-multipart
|
10 |
+
en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl
|