Spaces:
Sleeping
Sleeping
Download agent.py from gaurang671/SmartEmailAI2: direct link, hf CLI and curl.
- Browser
- Download file 318 Bytes
-
https://huggingface.co/spaces/gaurang671/SmartEmailAI2/resolve/main/agent.py
- Command line
-
hf download hf://spaces/gaurang671/SmartEmailAI2/agent.py
-
curl -L -o agent.py https://huggingface.co/spaces/gaurang671/SmartEmailAI2/resolve/main/agent.py
318 Bytes
| from transformers import pipeline | |
| classifier = pipeline("text-classification") | |
| def llm_agent(observation): | |
| result = classifier(observation)[0]['label'].lower() | |
| if "spam" in result: | |
| return "spam" | |
| elif "important" in result: | |
| return "important" | |
| else: | |
| return "normal" |