Spaces:
Runtime error
Runtime error
Download src/hf2.py from KhairulAmirinUM/testFastAPI: direct link, hf CLI and curl.
- Browser
- Download file 408 Bytes
-
https://huggingface.co/spaces/KhairulAmirinUM/testFastAPI/resolve/main/src/hf2.py
- Command line
-
hf download hf://spaces/KhairulAmirinUM/testFastAPI/src/hf2.py
-
curl -L -o hf2.py https://huggingface.co/spaces/KhairulAmirinUM/testFastAPI/resolve/main/src/hf2.py
408 Bytes
| from transformers import BertTokenizer, BertForSequenceClassification,TextClassificationPipeline, AutoModelForSequenceClassification | |
| # Load tokenizer and model from the fine-tuned directory | |
| model_path = 'intent_classification/TinyBERT_106_V2' # can try other checkpoints | |
| tokenizer = BertTokenizer.from_pretrained('huawei-noah/TinyBERT_General_4L_312D') | |
| tokenizer.save_pretrained(model_path) | |
| print('finish') |