reranker-int4-cpu / test_handler.py
jtl11's picture
Upload folder using huggingface_hub
7632e39 verified
raw
history blame contribute delete
515 Bytes
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)