Spaces:
Sleeping
Sleeping
Upload model.py
Browse filesfix model.py bug
model.py
CHANGED
|
@@ -17,6 +17,8 @@ MODEL_ID = "TypicaAI/magbert-ner"
|
|
| 17 |
#model = AutoModelForTokenClassification.from_pretrained(MODEL_ID, token=HF_TOKEN)
|
| 18 |
#ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="first")
|
| 19 |
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Authenticate using the secret `HFTOKEN`
|
| 22 |
def authenticate_with_token():
|
|
@@ -45,6 +47,6 @@ def load_healthcare_ner_pipeline():
|
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
-
#
|
| 49 |
ner_pipeline = load_healthcare_ner_pipeline()
|
| 50 |
|
|
|
|
| 17 |
#model = AutoModelForTokenClassification.from_pretrained(MODEL_ID, token=HF_TOKEN)
|
| 18 |
#ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="first")
|
| 19 |
|
| 20 |
+
# Initialize global pipeline
|
| 21 |
+
ner_pipeline = None
|
| 22 |
|
| 23 |
# Authenticate using the secret `HFTOKEN`
|
| 24 |
def authenticate_with_token():
|
|
|
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
+
# Get NER pipeline
|
| 51 |
ner_pipeline = load_healthcare_ner_pipeline()
|
| 52 |
|