Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request example to readme #2

Open
etsien opened this issue Jan 25, 2025 · 0 comments
Open

Add request example to readme #2

etsien opened this issue Jan 25, 2025 · 0 comments

Comments

@etsien
Copy link

etsien commented Jan 25, 2025

Hi! Thanks for putting this together, I was frustrated with trying to manually configure pytorch/CUDA for docling and found this. It's super helpful, but for newer users it would be helpful to structure the readme into a 1,2,3 step process on setup, and maybe include a section on how to actually send the request.

Something like an example of how to hit the endpoints you set up:

import requests
import json
import os

# API endpoint
url = "http://localhost:8080/parse/file"

# PDF file path
pdf_path = os.path.join("path", "to", "your", "file.pdf")

# Send request
response = requests.post(
    url,
    files={'file': open(pdf_path, 'rb')},
    data={'data': json.dumps({
        "include_json": False,
        "output_format": "markdown"
    })}
)

# ++ Code that handles the response, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant