Download test-handler.py from toktik-pgx/markuplm-large: direct link, hf CLI and curl.
- Browser
- Download file 608 Bytes
-
https://huggingface.co/toktik-pgx/markuplm-large/resolve/main/test-handler.py
- Command line
-
hf download hf://toktik-pgx/markuplm-large/test-handler.py
-
curl -L -o test-handler.py https://huggingface.co/toktik-pgx/markuplm-large/resolve/main/test-handler.py
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) | |