Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/arc53/doc2md
Browse files Browse the repository at this point in the history
  • Loading branch information
dartpain committed Nov 21, 2024
2 parents bd2405d + 7e409e4 commit ad60da4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
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](https://llm.arc53.com/docs#/)
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:
```python
# 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)
```

0 comments on commit ad60da4

Please sign in to comment.