Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -17,28 +17,8 @@ Check out the docs for the `/predict` endpoint below to try it out!
|
|
| 17 |
|
| 18 |
#### Python
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
url = "https://dog-fastapi-document-qa.hf.space/predict"
|
| 24 |
-
r = requests.get(
|
| 25 |
-
url,
|
| 26 |
-
files={"image_file": open("invoice.png", "rb")},
|
| 27 |
-
data={"question": "What is the invoice number?"}
|
| 28 |
-
)
|
| 29 |
-
print(r.json())
|
| 30 |
-
```
|
| 31 |
-
|
| 32 |
-
#### Curl
|
| 33 |
-
|
| 34 |
-
```bash
|
| 35 |
-
curl -X 'POST' \
|
| 36 |
-
'https://dog-fastapi-document-qa.hf.space/predict' \
|
| 37 |
-
-H 'accept: application/json' \
|
| 38 |
-
-H 'Content-Type: multipart/form-data' \
|
| 39 |
-
-F 'image_file=@invoice.png;type=image/png' \
|
| 40 |
-
-F 'question=What is the invoice number?'
|
| 41 |
-
```
|
| 42 |
"""
|
| 43 |
|
| 44 |
# NOTE - we configure docs_url to serve the interactive Docs at the root path
|
|
|
|
| 17 |
|
| 18 |
#### Python
|
| 19 |
|
| 20 |
+

|
| 21 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
"""
|
| 23 |
|
| 24 |
# NOTE - we configure docs_url to serve the interactive Docs at the root path
|