-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c47d39
commit c126b9c
Showing
8 changed files
with
84 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Python package | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: Install python dependencies | ||
run: | | ||
pip install poetry | ||
poetry install | ||
poetry remove torch | ||
poetry run pip install torch --index-url https://download.pytorch.org/whl/cpu | ||
- name: Build package | ||
run: | | ||
poetry build | ||
- name: Publish package | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
poetry config pypi-token.pypi "$PYPI_TOKEN" | ||
poetry publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import argparse | ||
import subprocess | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description="Convert a folder of PDFs to a folder of markdown files in chunks.") | ||
parser.add_argument("in_folder", help="Input folder with pdfs.") | ||
parser.add_argument("out_folder", help="Output folder") | ||
args = parser.parse_args() | ||
|
||
# Construct the command | ||
cmd = f"./chunk_convert.sh {args.in_folder} {args.out_folder}" | ||
|
||
# Execute the shell script | ||
subprocess.run(cmd, shell=True, check=True) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
[tool.poetry] | ||
name = "marker" | ||
version = "0.1.0" | ||
name = "marker-pdf" | ||
version = "0.1.1" | ||
description = "Convert PDF to markdown with high speed and accuracy." | ||
authors = ["Vik Paruchuri <[email protected]>"] | ||
readme = "README.md" | ||
license = "GPL-3.0-or-later" | ||
repository = "https://github.com/VikParuchuri/marker" | ||
keywords = ["pdf", "markdown", "ocr", "nlp"] | ||
packages = [ | ||
{include = "marker"} | ||
] | ||
include = [ | ||
"convert.py", | ||
"convert_single.py", | ||
"chunk_convert.sh", | ||
"benchmark.py", | ||
"chunk_convert.py", | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.9,<3.13" | ||
|
@@ -37,6 +47,12 @@ grpcio = "^1.60.0" | |
[tool.poetry.group.dev.dependencies] | ||
jupyter = "^1.0.0" | ||
|
||
[tool.poetry.scripts] | ||
marker = "convert:main" | ||
marker_single = "convert_single:main" | ||
marker_benchmark = "benchmark:main" | ||
marker_chunk_convert = "chunk_convert:main" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
build-backend = "poetry.core.masonry.api" |