Spaces:
Sleeping
Sleeping
Download Model_API/Model/model.py from darkbreakerk/triventure_ai: direct link, hf CLI and curl.
- Browser
- Download file 411 Bytes
-
https://huggingface.co/spaces/darkbreakerk/triventure_ai/resolve/main/Model_API/Model/model.py
- Command line
-
hf download hf://spaces/darkbreakerk/triventure_ai/Model_API/Model/model.py
-
curl -L -o model.py https://huggingface.co/spaces/darkbreakerk/triventure_ai/resolve/main/Model_API/Model/model.py
411 Bytes
| from transformers import BertForTokenClassification | |
| from .config_train import device, pretrain_model_name | |
| from .load_data import tag2idx | |
| # Fine-tuning BERT for token classification | |
| model = BertForTokenClassification.from_pretrained( | |
| # "bert-base-multilingual-cased", | |
| pretrain_model_name, | |
| num_labels=len(tag2idx), | |
| output_attentions = False, | |
| output_hidden_states = False | |
| ) | |
| model.to(device) | |