freddyaboulton HF staff commited on
Commit
d7d5446
1 Parent(s): c9901c6

Upload folder using huggingface_hub

Browse files
Dockerfile CHANGED
@@ -7,7 +7,6 @@ COPY --link --chown=1000 . .
7
 
8
  RUN mkdir -p /tmp/cache/
9
  RUN chmod a+rwx -R /tmp/cache/
10
- RUN apt-get update && apt-get install -y poppler-utils tesseract-ocr chromium
11
  ENV TRANSFORMERS_CACHE=/tmp/cache/
12
 
13
  RUN pip install --no-cache-dir -r requirements.txt
 
7
 
8
  RUN mkdir -p /tmp/cache/
9
  RUN chmod a+rwx -R /tmp/cache/
 
10
  ENV TRANSFORMERS_CACHE=/tmp/cache/
11
 
12
  RUN pip install --no-cache-dir -r requirements.txt
README.md CHANGED
@@ -1,9 +1,9 @@
1
 
2
  ---
3
- tags: [gradio-custom-component,machine learning,reproducibility,visualization,gradio,gradio-template-Fallback]
4
  title: gradio_pdf V0.0.3
5
- colorFrom: red
6
- colorTo: red
7
  sdk: docker
8
  pinned: false
9
  license: apache-2.0
@@ -12,6 +12,6 @@ license: apache-2.0
12
 
13
  # Name: gradio_pdf
14
 
15
- Description: Python library for easily interacting with trained machine learning models
16
 
17
  Install with: pip install gradio_pdf
 
1
 
2
  ---
3
+ tags: [gradio-custom-component,Documents,PDF,Document QA,gradio,gradio-template-Fallback]
4
  title: gradio_pdf V0.0.3
5
+ colorFrom: green
6
+ colorTo: pink
7
  sdk: docker
8
  pinned: false
9
  license: apache-2.0
 
12
 
13
  # Name: gradio_pdf
14
 
15
+ Description: Easily display PDFs in Gradio
16
 
17
  Install with: pip install gradio_pdf
__pycache__/__init__.cpython-39.pyc ADDED
Binary file (144 Bytes). View file
 
__pycache__/_app.cpython-310.pyc ADDED
Binary file (1.13 kB). View file
 
__pycache__/_app.cpython-39.pyc ADDED
Binary file (1.11 kB). View file
 
__pycache__/app.cpython-310.pyc CHANGED
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
 
__pycache__/app.cpython-39.pyc ADDED
Binary file (1.11 kB). View file
 
app.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  from _app import demo as app
4
  import os
5
 
6
- _docs = {'PDF': {'description': 'A base class for defining methods that all input/output components should have.', 'members': {'__init__': {'value': {'type': 'Any', 'default': 'None', 'description': None}, 'height': {'type': 'int | None', 'default': 'None', 'description': None}, 'label': {'type': 'str | None', 'default': 'None', 'description': None}, 'info': {'type': 'str | None', 'default': 'None', 'description': None}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': None}, 'container': {'type': 'bool', 'default': 'True', 'description': None}, 'scale': {'type': 'int | None', 'default': 'None', 'description': None}, 'min_width': {'type': 'int | None', 'default': 'None', 'description': None}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': None}, 'visible': {'type': 'bool', 'default': 'True', 'description': None}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': None}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': None}, 'render': {'type': 'bool', 'default': 'True', 'description': None}, 'load_fn': {'type': 'Callable[Ellipsis, Any] | None', 'default': 'None', 'description': None}, 'every': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': None}}, 'preprocess': {'return': {'type': 'str', 'description': None}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': ''}, 'upload': {'type': None, 'default': None, 'description': ''}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PDF': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
@@ -21,7 +21,7 @@ with gr.Blocks(
21
  # `gradio_pdf`
22
 
23
  <div style="display: flex; gap: 7px;">
24
- <a href="https://pypi.org/project/gradio_pdf/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_pdf"></a>
25
  </div>
26
 
27
  Easily display PDFs in Gradio
 
3
  from _app import demo as app
4
  import os
5
 
6
+ _docs = {'PDF': {'description': 'A base class for defining methods that all input/output components should have.', 'members': {'__init__': {'value': {'type': 'Any', 'default': 'None', 'description': None}, 'height': {'type': 'int | None', 'default': 'None', 'description': None}, 'label': {'type': 'str | None', 'default': 'None', 'description': None}, 'info': {'type': 'str | None', 'default': 'None', 'description': None}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': None}, 'container': {'type': 'bool', 'default': 'True', 'description': None}, 'scale': {'type': 'int | None', 'default': 'None', 'description': None}, 'min_width': {'type': 'int | None', 'default': 'None', 'description': None}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': None}, 'visible': {'type': 'bool', 'default': 'True', 'description': None}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': None}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': None}, 'render': {'type': 'bool', 'default': 'True', 'description': None}, 'load_fn': {'type': 'Callable[..., Any] | None', 'default': 'None', 'description': None}, 'every': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': None}}, 'preprocess': {'return': {'type': 'str', 'description': None}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': ''}, 'upload': {'type': None, 'default': None, 'description': ''}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PDF': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
 
21
  # `gradio_pdf`
22
 
23
  <div style="display: flex; gap: 7px;">
24
+ <a href="https://pypi.org/project/gradio_pdf/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_pdf"></a> <a href="https://github.com/freddyaboulton/gradio-pdf/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a> <a href="https://huggingface.co/spaces/freddyaboulton/gradio_pdf/discussions" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/%F0%9F%A4%97%20Discuss-%23097EFF?style=flat&logoColor=black"></a>
25
  </div>
26
 
27
  Easily display PDFs in Gradio
src/.gitignore CHANGED
@@ -6,4 +6,5 @@ __pycache__/
6
  *$py.class
7
  __tmp/*
8
  *.pyi
9
- node_modules
 
 
6
  *$py.class
7
  __tmp/*
8
  *.pyi
9
+ node_modules
10
+ templates/
src/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Freddy Boulton
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
src/README.md CHANGED
@@ -1,8 +1,8 @@
1
 
2
  # `gradio_pdf`
3
- <a href="https://pypi.org/project/gradio_pdf/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_pdf"></a>
4
 
5
- Python library for easily interacting with trained machine learning models
6
 
7
  ## Installation
8
 
@@ -234,7 +234,7 @@ bool
234
  <td align="left" style="width: 25%;">
235
 
236
  ```python
237
- Callable[Ellipsis, Any] | None
238
  ```
239
 
240
  </td>
 
1
 
2
  # `gradio_pdf`
3
+ <a href="https://pypi.org/project/gradio_pdf/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_pdf"></a> <a href="https://github.com/freddyaboulton/gradio-pdf/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a> <a href="https://huggingface.co/spaces/freddyaboulton/gradio_pdf/discussions" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/%F0%9F%A4%97%20Discuss-%23097EFF?style=flat&logoColor=black"></a>
4
 
5
+ Easily display PDFs in Gradio
6
 
7
  ## Installation
8
 
 
234
  <td align="left" style="width: 25%;">
235
 
236
  ```python
237
+ Callable[..., Any] | None
238
  ```
239
 
240
  </td>
src/demo/app.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  from _app import demo as app
4
  import os
5
 
6
- _docs = {'PDF': {'description': 'A base class for defining methods that all input/output components should have.', 'members': {'__init__': {'value': {'type': 'Any', 'default': 'None', 'description': None}, 'height': {'type': 'int | None', 'default': 'None', 'description': None}, 'label': {'type': 'str | None', 'default': 'None', 'description': None}, 'info': {'type': 'str | None', 'default': 'None', 'description': None}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': None}, 'container': {'type': 'bool', 'default': 'True', 'description': None}, 'scale': {'type': 'int | None', 'default': 'None', 'description': None}, 'min_width': {'type': 'int | None', 'default': 'None', 'description': None}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': None}, 'visible': {'type': 'bool', 'default': 'True', 'description': None}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': None}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': None}, 'render': {'type': 'bool', 'default': 'True', 'description': None}, 'load_fn': {'type': 'Callable[Ellipsis, Any] | None', 'default': 'None', 'description': None}, 'every': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': None}}, 'preprocess': {'return': {'type': 'str', 'description': None}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': ''}, 'upload': {'type': None, 'default': None, 'description': ''}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PDF': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
@@ -21,10 +21,10 @@ with gr.Blocks(
21
  # `gradio_pdf`
22
 
23
  <div style="display: flex; gap: 7px;">
24
- <a href="https://pypi.org/project/gradio_pdf/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_pdf"></a>
25
  </div>
26
 
27
- Python library for easily interacting with trained machine learning models
28
  """, elem_classes=["md-custom"], header_links=True)
29
  app.render()
30
  gr.Markdown(
 
3
  from _app import demo as app
4
  import os
5
 
6
+ _docs = {'PDF': {'description': 'A base class for defining methods that all input/output components should have.', 'members': {'__init__': {'value': {'type': 'Any', 'default': 'None', 'description': None}, 'height': {'type': 'int | None', 'default': 'None', 'description': None}, 'label': {'type': 'str | None', 'default': 'None', 'description': None}, 'info': {'type': 'str | None', 'default': 'None', 'description': None}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': None}, 'container': {'type': 'bool', 'default': 'True', 'description': None}, 'scale': {'type': 'int | None', 'default': 'None', 'description': None}, 'min_width': {'type': 'int | None', 'default': 'None', 'description': None}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': None}, 'visible': {'type': 'bool', 'default': 'True', 'description': None}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': None}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': None}, 'render': {'type': 'bool', 'default': 'True', 'description': None}, 'load_fn': {'type': 'Callable[..., Any] | None', 'default': 'None', 'description': None}, 'every': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': None}}, 'preprocess': {'return': {'type': 'str', 'description': None}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': ''}, 'upload': {'type': None, 'default': None, 'description': ''}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PDF': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
 
21
  # `gradio_pdf`
22
 
23
  <div style="display: flex; gap: 7px;">
24
+ <a href="https://pypi.org/project/gradio_pdf/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_pdf"></a> <a href="https://github.com/freddyaboulton/gradio-pdf/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a> <a href="https://huggingface.co/spaces/freddyaboulton/gradio_pdf/discussions" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/%F0%9F%A4%97%20Discuss-%23097EFF?style=flat&logoColor=black"></a>
25
  </div>
26
 
27
+ Easily display PDFs in Gradio
28
  """, elem_classes=["md-custom"], header_links=True)
29
  app.render()
30
  gr.Markdown(
src/pyproject.toml CHANGED
@@ -8,16 +8,16 @@ build-backend = "hatchling.build"
8
 
9
  [project]
10
  name = "gradio_pdf"
11
- version = "0.0.3"
12
- description = "Python library for easily interacting with trained machine learning models"
13
  readme = "README.md"
14
  license = "Apache-2.0"
15
  requires-python = ">=3.8"
16
- authors = [{ name = "YOUR NAME", email = "YOUREMAIL@domain.com" }]
17
  keywords = [
18
- "machine learning",
19
- "reproducibility",
20
- "visualization",
21
  "gradio",
22
  "gradio custom component",
23
  "gradio-template-Fallback"
@@ -42,8 +42,12 @@ classifiers = [
42
  [project.optional-dependencies]
43
  dev = ["build", "twine"]
44
 
 
 
 
 
45
  [tool.hatch.build]
46
- artifacts = ["/backend/gradio_pdf/templates", "*.pyi", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates"]
47
 
48
  [tool.hatch.build.targets.wheel]
49
  packages = ["/backend/gradio_pdf"]
 
8
 
9
  [project]
10
  name = "gradio_pdf"
11
+ version = "0.0.4"
12
+ description = "Easily display PDFs in Gradio"
13
  readme = "README.md"
14
  license = "Apache-2.0"
15
  requires-python = ">=3.8"
16
+ authors = [{ name = "Freddy Boulton", email = "alfonsoboulton@gmail.com" }]
17
  keywords = [
18
+ "Documents",
19
+ "PDF",
20
+ "Document QA",
21
  "gradio",
22
  "gradio custom component",
23
  "gradio-template-Fallback"
 
42
  [project.optional-dependencies]
43
  dev = ["build", "twine"]
44
 
45
+ [project.urls]
46
+ repository = "https://github.com/freddyaboulton/gradio-pdf"
47
+ space = "https://huggingface.co/spaces/freddyaboulton/gradio_pdf"
48
+
49
  [tool.hatch.build]
50
+ artifacts = ["/backend/gradio_pdf/templates", "*.pyi", "backend/gradio_pdf/templates", "backend/gradio_pdf/templates"]
51
 
52
  [tool.hatch.build.targets.wheel]
53
  packages = ["/backend/gradio_pdf"]