Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked from arc53/doc2md

Convert pdf and image files into markdown

License

Notifications You must be signed in to change notification settings

seigneurcui/doc2md

Repository files navigation

This project helps users to convert Documents (.pdf, .png, .jpg, .jpeg) into Markdown for you ease of ingestion into LLM workflows.

It uses a public LLM endpint (doc2md) here This endpoint simply gives images or pdfs (converted to images) to visual model and asks it to conver it into markdown.

Here is a quick snippet using python to perform such task:

# Client is your OpenAI compatible client
model = 'meta-llama/Llama-3.2-11B-Vision-Instruct'
prompt = "Convert the following image to just the markdown text, respond only with text and description of it if relevant."
messages = [
 {
 "role": "user",
 "content": [
 {
 "type": "text",
 "text": prompt,
 },
 {
 "type": "image_url",
 "image_url": {
 "url": f"{base64_image}"
 },
 },
 ]
 }
]
response = client.chat.completions.create(model=model,
 messages=messages,
 stream=False,
 max_tokens=int(max_new_tokens),
 **kwargs)

About

Convert pdf and image files into markdown

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 67.5%
  • JavaScript 16.6%
  • CSS 12.1%
  • HTML 3.8%

AltStyle によって変換されたページ (->オリジナル) /