Spaces:
Runtime error
Runtime error
Update download_model.py
Browse files- download_model.py +8 -1
download_model.py
CHANGED
@@ -1,6 +1,13 @@
|
|
1 |
from transformers import AutoModelForTokenClassification, AutoTokenizer
|
|
|
|
|
|
|
|
|
2 |
model_name = "w11wo/indonesian-roberta-base-posp-tagger"
|
|
|
3 |
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
4 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
5 |
model.save_pretrained('./model')
|
6 |
-
tokenizer.save_pretrained('./model')
|
|
|
|
1 |
from transformers import AutoModelForTokenClassification, AutoTokenizer
|
2 |
+
import logging
|
3 |
+
|
4 |
+
logging.basicConfig(level=logging.INFO)
|
5 |
+
|
6 |
model_name = "w11wo/indonesian-roberta-base-posp-tagger"
|
7 |
+
logging.info(f"Downloading model: {model_name}")
|
8 |
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
9 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
10 |
+
|
11 |
model.save_pretrained('./model')
|
12 |
+
tokenizer.save_pretrained('./model')
|
13 |
+
logging.info("Model and tokenizer saved successfully.")
|