Download test_trained_model.py from ChadlieOak/ae: direct link, hf CLI and curl.
- Browser
- Download file 1.63 kB
-
https://huggingface.co/ChadlieOak/ae/resolve/main/test_trained_model.py
- Command line
-
hf download hf://ChadlieOak/ae/test_trained_model.py
-
curl -L -o test_trained_model.py https://huggingface.co/ChadlieOak/ae/resolve/main/test_trained_model.py
1.63 kB
| #!/usr/bin/env python3 | |
| """ | |
| Test the trained cutting-edge model | |
| """ | |
| # We're now in the ae directory | |
| def test_model(): | |
| """Test the trained model.""" | |
| try: | |
| from persistent_model import load_and_use_model | |
| print("🧪 Testing cutting-edge model...") | |
| model = load_and_use_model('cutting_edge_model') | |
| if model is None: | |
| print("❌ Could not load model") | |
| return | |
| # Test some prompts | |
| test_prompts = [ | |
| "artificial intelligence is amazing", | |
| "machine learning algorithms are complex", | |
| "count the vowels in this sentence", | |
| "how many vowels in artificial intelligence", | |
| "deep learning is fascinating", | |
| "transformers revolutionized NLP", | |
| "attention mechanisms are powerful" | |
| ] | |
| print("\n📝 Testing prompts:") | |
| for prompt in test_prompts: | |
| result = model.prompt(prompt, 'auto') | |
| print(f"\nInput: {prompt}") | |
| print(f"Task: {result['task_type']}") | |
| if result['task_type'] == 'KNOW': | |
| print(f"Sentiment: {result['prediction']}") | |
| else: | |
| print(f"Action Value: {result['prediction']:.2f}") | |
| print(f"Route Probability: {result['route_probability']:.3f}") | |
| print("\n🎉 Model testing complete!") | |
| except Exception as e: | |
| print(f"❌ Error: {e}") | |
| import traceback | |
| traceback.print_exc() | |
| if __name__ == "__main__": | |
| test_model() |