-
Notifications
You must be signed in to change notification settings - Fork 120
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
Showing
7 changed files
with
54 additions
and
53 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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from indexify import Image | ||
|
||
|
||
chroma_image = Image(python="3.11").name("tensorlake/blueprints-chromadb").run("pip install chromadb").run("pip install pillow") | ||
|
||
st_image = ( | ||
Image(python="3.11") | ||
.name("tensorlake/pdf-blueprint-st") | ||
.run("pip install sentence-transformers") | ||
.run("pip install langchain") | ||
.run("pip install pillow") | ||
.run("pip install py-inkwell") | ||
) | ||
|
||
|
||
lance_image = Image(python="3.11").name("tensorlake/pdf-blueprint-lancdb").run("pip install lancedb") | ||
|
||
inkwell_image = ( | ||
Image(python="3.11") | ||
.name("tensorlake/pdf-blueprint-pdf-parser") | ||
.run("apt update") | ||
.run("apt install -y libgl1-mesa-glx git g++") | ||
.run("pip install torch") | ||
.run("pip install numpy") | ||
.run("pip install git+https://github.com/facebookresearch/[email protected]") | ||
.run("apt install -y tesseract-ocr") | ||
.run("apt install -y libtesseract-dev") | ||
.run("pip install \"py-inkwell[inference]\"") | ||
) | ||
|
||
inkwell_image_gpu = ( | ||
Image() | ||
.name("tensorlake/pdf-blueprint-pdf-parser-gpu") | ||
.base_image("pytorch/pytorch:2.4.1-cuda11.8-cudnn9-runtime") | ||
.run("apt update") | ||
.run("apt install -y libgl1-mesa-glx git g++") | ||
.run("pip install git+https://github.com/facebookresearch/[email protected]") | ||
.run("apt install -y tesseract-ocr") | ||
.run("apt install -y libtesseract-dev") | ||
.run("pip install \"py-inkwell[inference]\"") | ||
) |
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,39 +1,14 @@ | ||
from indexify.functions_sdk.data_objects import File | ||
from indexify.functions_sdk.indexify_functions import IndexifyFunction | ||
from indexify import Image | ||
|
||
from inkwell.api.document import Document | ||
|
||
image = ( | ||
Image(python="3.11") | ||
.name("tensorlake/pdf-blueprint-pdf-parser") | ||
.run("apt update") | ||
.run("apt install -y libgl1-mesa-glx git g++") | ||
.run("pip install torch") | ||
.run("pip install numpy") | ||
.run("pip install git+https://github.com/facebookresearch/[email protected]") | ||
.run("apt install -y tesseract-ocr") | ||
.run("apt install -y libtesseract-dev") | ||
.run("pip install \"py-inkwell[inference]\"") | ||
) | ||
|
||
gpu_image = ( | ||
Image() | ||
.name("tensorlake/pdf-blueprint-pdf-parser-gpu") | ||
.base_image("pytorch/pytorch:2.4.1-cuda11.8-cudnn9-runtime") | ||
.run("apt update") | ||
.run("apt install -y libgl1-mesa-glx git g++") | ||
.run("pip install git+https://github.com/facebookresearch/[email protected]") | ||
.run("apt install -y tesseract-ocr") | ||
.run("apt install -y libtesseract-dev") | ||
.run("pip install \"py-inkwell[inference]\"") | ||
) | ||
from images import inkwell_image_gpu | ||
|
||
class PDFParser(IndexifyFunction): | ||
name = "pdf-parse" | ||
description = "Parser class that captures a pdf file" | ||
# Change to gpu_image to use GPU | ||
image = gpu_image | ||
image = inkwell_image_gpu | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
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