Download predict.py from houselearning/IntentSnap-AI: direct link, hf CLI and curl.
- Browser
- Download file 381 Bytes
-
https://huggingface.co/houselearning/IntentSnap-AI/resolve/main/predict.py
- Command line
-
hf download hf://houselearning/IntentSnap-AI/predict.py
-
curl -L -o predict.py https://huggingface.co/houselearning/IntentSnap-AI/resolve/main/predict.py
381 Bytes
| from transformers import pipeline | |
| classifier = pipeline( | |
| "text-classification", | |
| model="./model", | |
| tokenizer="./model" | |
| ) | |
| print("🤖 IntentSnap-AI (type 'exit' to quit)\n") | |
| while True: | |
| text = input("> ") | |
| if text.lower() in ["exit", "quit"]: | |
| break | |
| result = classifier(text)[0] | |
| print(f"🎯 Intent: {result['label']} ({result['score']:.2f})\n") | |