Download eval.py from srajam696/mlops-assignment2-distilbert: direct link, hf CLI and curl.
- Browser
- Download file 376 Bytes
-
https://huggingface.co/srajam696/mlops-assignment2-distilbert/resolve/main/eval.py
- Command line
-
hf download hf://srajam696/mlops-assignment2-distilbert/eval.py
-
curl -L -o eval.py https://huggingface.co/srajam696/mlops-assignment2-distilbert/resolve/main/eval.py
376 Bytes
| from transformers import DistilBertForSequenceClassification, Trainer | |
| from train import train_model | |
| def evaluate(): | |
| # In a real pipeline, we'd load the saved model | |
| trainer, test_dataset = train_model() | |
| results = trainer.evaluate() | |
| print(results) | |
| with open('results.txt', 'w') as f: | |
| f.write(str(results)) | |
| if __name__ == '__main__': | |
| evaluate() | |