File size: 515 Bytes
c01138f
 
 
 
 
 
7632e39
c01138f
 
 
 
 
7632e39
c01138f
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from handler import EndpointHandler

# init handler
my_handler = EndpointHandler(path=".")

# prepare sample payload
payload = dict(inputs=dict(
    query = "What is the capital of China?",
    documents = [
    "The capital of China is Beijing.",
    "Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun.",
    ],
))

# test the handler
scores=my_handler(payload)

# show results
print("scores", scores)