Skip to content

Commit

Permalink
feat: nougat-demo
Browse files Browse the repository at this point in the history
Signed-off-by: 117503445 <[email protected]>
  • Loading branch information
117503445 committed Sep 26, 2023
1 parent 28ab391 commit bdcba80
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions experiment/nougat-demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
out
*.pdf
15 changes: 15 additions & 0 deletions experiment/nougat-demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime

# RUN apt-get update && apt-get install gcc git ffmpeg libsm6 libxext6 -y
# RUN pip uninstall numpy pillow -y
# RUN pip install Pillow==9.1
# RUN python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.8/index.html
# RUN pip install layoutparser pymupdf
# COPY download.py /scripts/download.py
# RUN python /scripts/download.py

RUN pip install nougat-ocr[api]

WORKDIR /workspace/nougat-demo

ENTRYPOINT [ "bash" ]
30 changes: 30 additions & 0 deletions experiment/nougat-demo/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3.9'
services:
nougat-demo-dev:
build:
# context: ./src/flow_pdf
dockerfile: Dockerfile

container_name: nougat-demo-dev
# restart: unless-stopped
volumes:
- ./:/workspace/nougat-demo
# - '${INPUT_PATH}:/workspace/nougat-demo/data/input'
# - '${LAYOUT_PARSER_OUTPUT_PATH}:/workspace/nougat-demo/data/layout-parser-output'

# - '${FLOWPDF_OUTPUT_PATH}:/workspace/nougat-demo/data/nougat-demo_output'

# - './src/flow_pdf:/workspace/flow_pdf'
# - './vsc_extensions/flow_pdf:/root/.vscode-server/extensions'
ports:
- '8503:8503'
stdin_open: true
tty: true
deploy:
# replicas: ${ENABLE_LAYOUT_PARSER}
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
5 changes: 5 additions & 0 deletions experiment/nougat-demo/note.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pip install "nougat-ocr[api]"


nougat hotstuff.pdf -o out -m 0.1.0-base --markdown
nougat bitcoin.pdf -o out -m 0.1.0-base --markdown

0 comments on commit bdcba80

Please sign in to comment.