File size: 569 Bytes
b603fd0
 
7f4471a
b603fd0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import requests

url = "https://lucabadiali-ml-ops-project.hf.space/predict"

data = {
    "input_texts" : [
            "Today I am feeling very happy!!",
            "Today I am not feeling very happy at all!!",
            "Today I am feeling no particular mood."]
}


response = requests.post(url, json=data)

if response.status_code == 200:
    response_json = response.json()
    print(response_json["status"])
    for message in response_json["response_body"]:
        print(message)
        
else:
    print(f"error: {response.status_code} - {response.json()}")