File size: 462 Bytes
21b4ef9
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import requests

url = "https://api-inference.huggingface.co/models/your-username/linear-regression-model"
headers = {"Authorization": "Bearer YOUR_HUGGINGFACE_API_TOKEN"}

# Define the columns and open the CSV file in binary mode
columns = ["feature1", "feature2", "feature3"]
files = {
    "inputs": ("data.csv", open("path/to/your/data.csv", "rb")),
    "columns": columns
}

response = requests.post(url, headers=headers, files=files)
print(response.json())