Spaces:
Sleeping
Sleeping
Download retrain_on_server.py from APEXPRIT/deception-analysis-api: direct link, hf CLI and curl.
- Browser
- Download file 697 Bytes
-
https://huggingface.co/spaces/APEXPRIT/deception-analysis-api/resolve/main/retrain_on_server.py
- Command line
-
hf download hf://spaces/APEXPRIT/deception-analysis-api/retrain_on_server.py
-
curl -L -o retrain_on_server.py https://huggingface.co/spaces/APEXPRIT/deception-analysis-api/resolve/main/retrain_on_server.py
697 Bytes
| import os | |
| import sys | |
| from create_pretrained_model import create_pretrained_model | |
| def main(): | |
| print("🚀 STARTING ON-SERVER MODEL RETRAINING...") | |
| # Define output directory | |
| output_dir = "./models" | |
| os.makedirs(output_dir, exist_ok=True) | |
| # Run the model creation process which: | |
| # 1. Generates synthetic data | |
| # 2. Trains the classifier | |
| # 3. Saves it in the server's native format (fixing version mismatch) | |
| create_pretrained_model( | |
| output_dir=output_dir, | |
| n_samples=2000, | |
| random_state=42 | |
| ) | |
| print("✅ RETRAINING COMPLETE! Model is now perfectly synced with server versions.") | |
| if __name__ == "__main__": | |
| main() | |