File size: 1,082 Bytes
5c4dcc9
 
 
 
 
 
 
20efac6
 
 
 
 
 
 
 
 
 
 
 
 
 
5c4dcc9
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from handler import EndpointHandler

# Initialize the handler with the local model path
my_handler = EndpointHandler(path=".")

# Example payload
data = {
    "inputs": [
        {
            "id": "1",
            "chunk": "Prior to restoration work performed between 1990 and 2001, Leaning Tower of Pisa leaned at an angle of 5.5 degrees, but the tower now leans at about 3.99 degrees. This means the top of the tower is displaced horizontally 3.9 meters (12 ft 10 in) from the center.",
            "title": "Leaning Tower of Pisa",
            "date": "2023-01-01",
        },
        {
            "id": "2",
            "chunk": "Prior to restoration work performed between 1990 and 2001, Leaning Tower of Pisa leaned at an angle of 5.5 degrees, but the tower now leans at about 3.99 degrees. This means the top of the tower is displaced horizontally 3.9 meters (12 ft 10 in) from the center.",
            "title": "Leaning Tower of Pisa",
            "date": "2023-01-02",
        },
    ]
}

# Call the handler and print the output
output = my_handler(data)
print(output)