Spaces:
Sleeping
Sleeping
Download test_model.py from FuzzyD1no/kasaysayan-check: direct link, hf CLI and curl.
- Browser
- Download file 671 Bytes
-
https://huggingface.co/spaces/FuzzyD1no/kasaysayan-check/resolve/main/test_model.py
- Command line
-
hf download hf://spaces/FuzzyD1no/kasaysayan-check/test_model.py
-
curl -L -o test_model.py https://huggingface.co/spaces/FuzzyD1no/kasaysayan-check/resolve/main/test_model.py
671 Bytes
| from transformers import pipeline | |
| # Load your local trained model | |
| try: | |
| checker = pipeline("text-classification", model="./kasaysayan_bert_model", tokenizer="./kasaysayan_bert_model") | |
| # Test cases | |
| test_claims = [ | |
| "The economy grew by 5% in 1975 according to World Bank records.", # Should be 'Objective' | |
| "DELUSIONAL CRITICS ARE HIDING THE TRUTH ABOUT THE GOLDEN AGE!!!", # Should be 'Troll/Suspicious' | |
| ] | |
| for claim in test_claims: | |
| result = checker(claim) | |
| print(f"Claim: {claim}\nResult: {result}\n") | |
| except Exception as e: | |
| print(f"Error loading model: {e}. Did you finish running train_bert.py?") |