Spaces:
Sleeping
Sleeping
Create calling_script.py
Browse files- calling_script.py +12 -0
calling_script.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from pydantic import BaseModel
|
| 4 |
+
|
| 5 |
+
class Item(BaseModel):
|
| 6 |
+
text: str = "I miss you"
|
| 7 |
+
|
| 8 |
+
url = "https://tensorgirl-text-emotion.hf.space/classify/"
|
| 9 |
+
input_data = Item(text='I miss you')
|
| 10 |
+
|
| 11 |
+
response = requests.post(url, json = input_data.dict())
|
| 12 |
+
print(response.text)
|