Spaces:
Build error
Build error
Download sample.py from AuditEdge/optimised-ocr: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/spaces/AuditEdge/optimised-ocr/resolve/main/sample.py
- Command line
-
hf download hf://spaces/AuditEdge/optimised-ocr/sample.py
-
curl -L -o sample.py https://huggingface.co/spaces/AuditEdge/optimised-ocr/resolve/main/sample.py
1.13 kB
| import requests | |
| import sys | |
| # Define the API endpoint | |
| # url = "http://localhost:7680/" | |
| # # test_url = "http://localhost:7860/" | |
| # response = requests.get(url) | |
| # sys.exit() | |
| post_url = "http://localhost:7680/api/aadhar_ocr" | |
| # post_url = "https://auditedge-optimised-ocr.hf.space/api/aadhar_ocr" | |
| # url = "https://auditedge-optimised-ocr.hf.space/" | |
| # response = requests.get(url) | |
| # print("Status Code:", response.status_code) | |
| # print("Response Text:", response.text) | |
| # # print() | |
| # # Define the file pathscd | |
| files = { | |
| # "aadhar_file": open("/Users/javed/Downloads/test_images_folder/aadhar/22.jpg", "rb") | |
| # "pan_file": open("/Users/javed/Downloads/test_images_folder/pan/fcc.14eb7.jpg", "rb"), | |
| # "cheque_file": open("/Users/javed/Downloads/test_images_folder/cheque/2.jpeg", "rb"), | |
| "gst_file": open("/Users/javed/Downloads/test_images_folder/gst/e.2.pdf", "rb") | |
| # "gst_file": open("/Users/javed/Downloads/test_images_folder/gst/x.pdf", "rb") | |
| } | |
| response = requests.post(post_url, files=files) | |
| # # Print the response | |
| print("Status Code:", response.status_code) | |
| print("Response Text:", response.text) |