Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,8 @@ from transformers import AutoTokenizer, AutoModelForTokenClassification
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
# Load model and tokenizer once
|
| 6 |
-
model_name = "zekun-li/geolm-base-toponym-recognition"
|
|
|
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 8 |
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
| 9 |
model.to("cpu") # Use "cuda" if you have GPU
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
# Load model and tokenizer once
|
| 6 |
+
# model_name = "zekun-li/geolm-base-toponym-recognition"
|
| 7 |
+
model_name = "knowledge-computing/geolm-base-toponym-recognition"
|
| 8 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 9 |
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
| 10 |
model.to("cpu") # Use "cuda" if you have GPU
|