markuplm-large / test-handler.py
Tigran Tokmajyan
Various changes
093705f
raw
history blame contribute delete
608 Bytes
from handler import EndpointHandler
# init handler
my_handler = EndpointHandler(path=".")
# prepare sample payload
payload = {"inputs": { "context": """<body>
<h1>Company Information</h1>
<p>Welcome to the official website of <strong>ExampleCorp</strong>.</p>
<h2>About Us</h2>
<p>ExampleCorp is a leading provider of innovative tech solutions.</p>
<h2>Contact Information</h2>
<p>Email: contact@example.com</p>
<p>Phone: +1-800-555-1234</p>
</body>""", "question": "What is the email address?"}}
# test the handler
pred=my_handler(payload)
# show results
print("pred", pred)