Spaces:
Sleeping
Sleeping
Download calling_script.py from tensorgirl/Text_emotion: direct link, hf CLI and curl.
- Browser
- Download file 286 Bytes
-
https://huggingface.co/spaces/tensorgirl/Text_emotion/resolve/main/calling_script.py
- Command line
-
hf download hf://spaces/tensorgirl/Text_emotion/calling_script.py
-
curl -L -o calling_script.py https://huggingface.co/spaces/tensorgirl/Text_emotion/resolve/main/calling_script.py
286 Bytes
| import requests | |
| import json | |
| from pydantic import BaseModel | |
| class Item(BaseModel): | |
| text: str = "I miss you" | |
| url = "https://tensorgirl-text-emotion.hf.space/classify/" | |
| input_data = Item(text='I miss you') | |
| response = requests.post(url, json = input_data.dict()) | |
| print(response.text) |