lterriel commited on
Commit
dc0c3a6
·
1 Parent(s): 604b2d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -27,9 +27,9 @@ ENTITY_COLORS = {
27
 
28
  MAP_MODELS = {
29
  "":"",
30
- "fr_ner4archives_V3_camembert_base": "https://huggingface.co/ner4archives/fr_ner4archives_V3_camembert_base/resolve/main/fr_ner4archives_V3_camembert_base-any-py3-none-any.whl#sha256=919aca257e4b2342a3773e7dcc3442b30f2ac50c4a3466d5ecda5e0e337ea396",
31
- "fr_ner4archives_v3_default": "https://huggingface.co/ner4archives/fr_ner4archives_v3_default/resolve/main/fr_ner4archives_v3_default-any-py3-none-any.whl#sha256=040a5c67a7e5a14e0125b2600e6aff1323f8ba9d800d5ab49446faeaf2dad6e6",
32
- "fr_ner4archives_v3_with_vectors":"https://huggingface.co/ner4archives/fr_ner4archives_v3_with_vectors/resolve/main/fr_ner4archives_v3_with_vectors-any-py3-none-any.whl#sha256=4c938618ce84a919008d17822980cfd914f9ad8f73231a64cd1ffcaa80ab09f2"
33
  }
34
 
35
 
@@ -147,7 +147,7 @@ def main():
147
  model_loaded = None
148
  if model != "":
149
  try:
150
- model_loaded = spacy.load(model)
151
  flag_model = True
152
  streamlit.write(f"{model} is available locally.")
153
  except:
@@ -160,7 +160,6 @@ def main():
160
  o = p1.wait()
161
  if o == 0:
162
  streamlit.write(f"Download model: {model} done.")
163
- model_loaded = spacy.load(model)
164
  flag_model = True
165
  streamlit.write(f"{model} is available locally.")
166
  placeholder.empty()
@@ -193,7 +192,7 @@ def main():
193
  if streamlit.button('Launch'):
194
  plain = "\n".join(sentences)
195
  with streamlit.spinner('Initialize NER...'):
196
- nlp = model_loaded
197
  nlp.max_length = 5000000
198
  if linking:
199
  nlp.add_pipe('entityfishing',
 
27
 
28
  MAP_MODELS = {
29
  "":"",
30
+ "fr_ner4archives_V3_camembert_base": "https://huggingface.co/ner4archives/fr_ner4archives_V3_camembert_base/resolve/main/fr_ner4archives_V3_camembert_base-any-py3-none-any.whl",
31
+ "fr_ner4archives_v3_default": "https://huggingface.co/ner4archives/fr_ner4archives_v3_default/resolve/main/fr_ner4archives_v3_default-any-py3-none-any.whl",
32
+ "fr_ner4archives_v3_with_vectors":"https://huggingface.co/ner4archives/fr_ner4archives_v3_with_vectors/resolve/main/fr_ner4archives_v3_with_vectors-any-py3-none-any.whl"
33
  }
34
 
35
 
 
147
  model_loaded = None
148
  if model != "":
149
  try:
150
+ spacy.load(model)
151
  flag_model = True
152
  streamlit.write(f"{model} is available locally.")
153
  except:
 
160
  o = p1.wait()
161
  if o == 0:
162
  streamlit.write(f"Download model: {model} done.")
 
163
  flag_model = True
164
  streamlit.write(f"{model} is available locally.")
165
  placeholder.empty()
 
192
  if streamlit.button('Launch'):
193
  plain = "\n".join(sentences)
194
  with streamlit.spinner('Initialize NER...'):
195
+ nlp = spacy.load(model)
196
  nlp.max_length = 5000000
197
  if linking:
198
  nlp.add_pipe('entityfishing',