Modify: requirements.txt; Fix: load 'en' in Gramformer
Browse files- README.md +0 -1
- app.py +1 -1
- gramformer/gramformer.py +3 -1
- requirements.txt +2 -1
README.md
CHANGED
@@ -4,7 +4,6 @@ emoji: 💩
|
|
4 |
colorFrom: blue
|
5 |
colorTo: gray
|
6 |
sdk: streamlit
|
7 |
-
sdk_version: 0.79.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
|
|
4 |
colorFrom: blue
|
5 |
colorTo: gray
|
6 |
sdk: streamlit
|
|
|
7 |
app_file: app.py
|
8 |
pinned: false
|
9 |
---
|
app.py
CHANGED
@@ -146,4 +146,4 @@ class GramformerDemo:
|
|
146 |
|
147 |
if __name__ == "__main__":
|
148 |
obj = GramformerDemo()
|
149 |
-
obj.main()
|
|
|
146 |
|
147 |
if __name__ == "__main__":
|
148 |
obj = GramformerDemo()
|
149 |
+
obj.main()
|
gramformer/gramformer.py
CHANGED
@@ -5,7 +5,9 @@ class Gramformer:
|
|
5 |
from transformers import AutoModelForSeq2SeqLM
|
6 |
from lm_scorer.models.auto import AutoLMScorer as LMScorer
|
7 |
import errant
|
8 |
-
|
|
|
|
|
9 |
|
10 |
if use_gpu:
|
11 |
device= "cuda:0"
|
|
|
5 |
from transformers import AutoModelForSeq2SeqLM
|
6 |
from lm_scorer.models.auto import AutoLMScorer as LMScorer
|
7 |
import errant
|
8 |
+
import en_core_web_sm
|
9 |
+
nlp = en_core_web_sm.load()
|
10 |
+
self.annotator = errant.load('en', nlp)
|
11 |
|
12 |
if use_gpu:
|
13 |
device= "cuda:0"
|
requirements.txt
CHANGED
@@ -6,4 +6,5 @@ python-Levenshtein==0.12.2
|
|
6 |
fuzzywuzzy==0.18.0
|
7 |
tokenizers==0.10.2
|
8 |
fsspec==2021.5.0
|
9 |
-
|
|
|
|
6 |
fuzzywuzzy==0.18.0
|
7 |
tokenizers==0.10.2
|
8 |
fsspec==2021.5.0
|
9 |
+
spacy==2.3.0
|
10 |
+
errant==2.2.0
|