quantaji commited on
Commit
2d902f4
1 Parent(s): 9ee83a7
Files changed (5) hide show
  1. .gitattributes copy +0 -1
  2. Dockerfile +7 -2
  3. README copy.md +0 -14
  4. README.md +15 -0
  5. core/read_pdf.py +4 -8
.gitattributes copy DELETED
@@ -1 +0,0 @@
1
- example.pdf filter=lfs diff=lfs merge=lfs -text
 
 
Dockerfile CHANGED
@@ -22,18 +22,23 @@ RUN git clone https://github.com/allenai/pdffigures2.git
22
  WORKDIR /project
23
  ADD ./requirements.txt /project/requirements.txt
24
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
25
- # add code
26
- ADD ./core/ /project/core/
27
  # download tokernizer for nltk
28
  RUN python core/init_nltk.py
29
  ADD ./example.pdf /project/example/example.pdf
30
  # init sbt
 
 
31
  RUN python core/init_sbt.py
32
  # add app
33
  ADD ./app.py /project/app.py
34
  EXPOSE 7860
35
  EXPOSE 8070
36
  EXPOSE 8071
 
 
 
37
  # add service starting
38
  ADD ./start_service.sh /project/start_service.sh
39
 
 
22
  WORKDIR /project
23
  ADD ./requirements.txt /project/requirements.txt
24
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
25
+ # add nltk
26
+ ADD ./core/init_nltk.py /project/core/init_nltk.py
27
  # download tokernizer for nltk
28
  RUN python core/init_nltk.py
29
  ADD ./example.pdf /project/example/example.pdf
30
  # init sbt
31
+ # add code
32
+ ADD ./core/init_sbt.py /project/core/init_sbt.py
33
  RUN python core/init_sbt.py
34
  # add app
35
  ADD ./app.py /project/app.py
36
  EXPOSE 7860
37
  EXPOSE 8070
38
  EXPOSE 8071
39
+
40
+ # add code
41
+ ADD ./core/ /project/core/
42
  # add service starting
43
  ADD ./start_service.sh /project/start_service.sh
44
 
README copy.md DELETED
@@ -1,14 +0,0 @@
1
- # docker integration of existing code
2
- build docker
3
- ```sh
4
- docker build --tag doc2slide -f Dockerfile .
5
- ```
6
- run in interactive mode and use gpu
7
- ```sh
8
- docker run --name test --gpus all -p 7080:8070 -p 7081:8071 -p 7860:7860 --rm -it doc2slide bash
9
- ```
10
- current version of grobid 0.7.3 have python 3.8.10 and openjdk 17. To run as a service
11
- ```sh
12
- docker run -d --name test --gpus all -p 7080:8070 -p 7081:8071 -p 7860:7860 --rm doc2slide
13
- ```
14
- https://shinylive.io/py/examples gives a lot of examples
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -8,3 +8,18 @@ pinned: false
8
  ---
9
 
10
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ---
9
 
10
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
11
+
12
+ # docker integration of existing code
13
+ build docker
14
+ ```sh
15
+ docker build --tag doc2slide -f Dockerfile .
16
+ ```
17
+ run in interactive mode and use gpu
18
+ ```sh
19
+ docker run --name test --gpus all -p 7080:8070 -p 7081:8071 -p 7860:7860 --rm -it doc2slide bash
20
+ ```
21
+ current version of grobid 0.7.3 have python 3.8.10 and openjdk 17. To run as a service
22
+ ```sh
23
+ docker run -d --name test --gpus all -p 7080:8070 -p 7081:8071 -p 7860:7860 --rm doc2slide
24
+ ```
25
+ https://shinylive.io/py/examples gives a lot of examples
core/read_pdf.py CHANGED
@@ -12,14 +12,10 @@ if module_path not in sys.path:
12
 
13
  from core.tei import single_entry
14
 
15
- # temp_dir = '/project/temp'
16
- # pdffigures2_home = '/opt/pdffigures2'
17
- # grobid_home = '/opt/grobid'
18
- # grobid_python_config_pth = '/opt/grobid_client_python/config.json
19
- temp_dir = '/home/quanta/Projects/doc2slide-summarizer/temp'
20
- pdffigures2_home = '/home/quanta/Library/pdffigures2'
21
- grobid_home = '/home/quanta/Library/grobid/grobid-0.6.2'
22
- grobid_python_config_pth = '/home/quanta/Library/grobid_client_python/config.json'
23
 
24
 
25
  def remove_temp_directory():
 
12
 
13
  from core.tei import single_entry
14
 
15
+ temp_dir = '/project/temp'
16
+ pdffigures2_home = '/opt/pdffigures2'
17
+ grobid_home = '/opt/grobid'
18
+ grobid_python_config_pth = '/opt/grobid_client_python/config.json'
 
 
 
 
19
 
20
 
21
  def remove_temp_directory():