embed-anything-gpu 0.1.22__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. embed_anything_gpu-0.1.22/.gitattributes +3 -0
  2. embed_anything_gpu-0.1.22/.github/workflows/CI.yml +157 -0
  3. embed_anything_gpu-0.1.22/.github/workflows/CI_cuda.yml +156 -0
  4. embed_anything_gpu-0.1.22/.github/workflows/docs.yml +42 -0
  5. embed_anything_gpu-0.1.22/.gitignore +73 -0
  6. embed_anything_gpu-0.1.22/Cargo.lock +4796 -0
  7. embed_anything_gpu-0.1.22/Cargo.toml +79 -0
  8. embed_anything_gpu-0.1.22/LICENSE +201 -0
  9. embed_anything_gpu-0.1.22/PKG-INFO +252 -0
  10. embed_anything_gpu-0.1.22/README.md +238 -0
  11. embed_anything_gpu-0.1.22/docs/index.md +153 -0
  12. embed_anything_gpu-0.1.22/docs/references.md +3 -0
  13. embed_anything_gpu-0.1.22/examples/audio.py +24 -0
  14. embed_anything_gpu-0.1.22/examples/audio.rs +28 -0
  15. embed_anything_gpu-0.1.22/examples/bert.py +33 -0
  16. embed_anything_gpu-0.1.22/examples/bert.rs +29 -0
  17. embed_anything_gpu-0.1.22/examples/clip.py +36 -0
  18. embed_anything_gpu-0.1.22/examples/clip.rs +75 -0
  19. embed_anything_gpu-0.1.22/examples/images/blue_jacket.jpg +0 -0
  20. embed_anything_gpu-0.1.22/examples/images/coat.jpg +0 -0
  21. embed_anything_gpu-0.1.22/examples/images/faux.webp +0 -0
  22. embed_anything_gpu-0.1.22/examples/images/shirt.jpg +0 -0
  23. embed_anything_gpu-0.1.22/examples/images/white shirt.jpg +0 -0
  24. embed_anything_gpu-0.1.22/examples/web.py +3 -0
  25. embed_anything_gpu-0.1.22/examples/web_embed.rs +60 -0
  26. embed_anything_gpu-0.1.22/mkdocs.yml +18 -0
  27. embed_anything_gpu-0.1.22/pyproject.toml +30 -0
  28. embed_anything_gpu-0.1.22/python/embed_anything/__init__.py +80 -0
  29. embed_anything_gpu-0.1.22/python/embed_anything/embed_anything.pyi +222 -0
  30. embed_anything_gpu-0.1.22/python/embed_anything/libiomp5md.dll +0 -0
  31. embed_anything_gpu-0.1.22/python/embed_anything/py.typed +0 -0
  32. embed_anything_gpu-0.1.22/python/embed_anything/vectorDB.py +47 -0
  33. embed_anything_gpu-0.1.22/src/config.rs +143 -0
  34. embed_anything_gpu-0.1.22/src/embedding_model/bert.rs +175 -0
  35. embed_anything_gpu-0.1.22/src/embedding_model/clip.rs +306 -0
  36. embed_anything_gpu-0.1.22/src/embedding_model/embed.rs +111 -0
  37. embed_anything_gpu-0.1.22/src/embedding_model/jina.rs +166 -0
  38. embed_anything_gpu-0.1.22/src/embedding_model/mod.rs +7 -0
  39. embed_anything_gpu-0.1.22/src/embedding_model/openai.rs +187 -0
  40. embed_anything_gpu-0.1.22/src/file_loader.rs +254 -0
  41. embed_anything_gpu-0.1.22/src/file_processor/audio/audio_processor.rs +548 -0
  42. embed_anything_gpu-0.1.22/src/file_processor/audio/melfilters.bytes +0 -0
  43. embed_anything_gpu-0.1.22/src/file_processor/audio/melfilters128.bytes +0 -0
  44. embed_anything_gpu-0.1.22/src/file_processor/audio/mod.rs +2 -0
  45. embed_anything_gpu-0.1.22/src/file_processor/audio/pcm_decode.rs +74 -0
  46. embed_anything_gpu-0.1.22/src/file_processor/markdown_processor.rs +46 -0
  47. embed_anything_gpu-0.1.22/src/file_processor/mod.rs +13 -0
  48. embed_anything_gpu-0.1.22/src/file_processor/pdf_processor.rs +47 -0
  49. embed_anything_gpu-0.1.22/src/file_processor/txt_processor.rs +58 -0
  50. embed_anything_gpu-0.1.22/src/file_processor/website_processor.rs +175 -0
  51. embed_anything_gpu-0.1.22/src/lib.rs +573 -0
  52. embed_anything_gpu-0.1.22/src/text_loader.rs +126 -0
  53. embed_anything_gpu-0.1.22/test.py +47 -0
  54. embed_anything_gpu-0.1.22/test_files/attention.pdf +0 -0
  55. embed_anything_gpu-0.1.22/test_files/audio/samples_hp0.wav +0 -0
  56. embed_anything_gpu-0.1.22/test_files/audio/samples_jfk.wav +0 -0
  57. embed_anything_gpu-0.1.22/test_files/clip/cat1.jpg +0 -0
  58. embed_anything_gpu-0.1.22/test_files/clip/cat2.jpeg +0 -0
  59. embed_anything_gpu-0.1.22/test_files/clip/dog1.jpg +0 -0
  60. embed_anything_gpu-0.1.22/test_files/clip/dog2.jpeg +0 -0
  61. embed_anything_gpu-0.1.22/test_files/clip/monkey1.jpg +0 -0
  62. embed_anything_gpu-0.1.22/test_files/test.md +10 -0
  63. embed_anything_gpu-0.1.22/test_files/test.pdf +0 -0
  64. embed_anything_gpu-0.1.22/test_files/test.txt +1 -0
@@ -0,0 +1,3 @@
1
+ * text=auto eol=lf
2
+ *.{cmd,[cC][mM][dD]} text eol=crlf
3
+ *.{bat,[bB][aA][tT]} text eol=crlf
@@ -0,0 +1,157 @@
1
+ # This file is autogenerated by maturin v1.7.0
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci github
5
+ #
6
+ name: CI
7
+
8
+ on:
9
+ push:
10
+ branches:
11
+ - main
12
+ - master
13
+ tags:
14
+ - '*'
15
+ pull_request:
16
+ workflow_dispatch:
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ linux:
23
+ runs-on: ${{ matrix.platform.runner }}
24
+ strategy:
25
+ matrix:
26
+ platform:
27
+ - runner: ubuntu-latest
28
+ target: x86_64
29
+
30
+ steps:
31
+ - name: Checkout code
32
+ uses: actions/checkout@v4
33
+
34
+
35
+ - name: Set up Python
36
+ uses: actions/setup-python@v5
37
+ with:
38
+ python-version: '>=3.10' # Choose the Python version you need
39
+
40
+ - name: Install Maturin
41
+ run: |
42
+ python3 -m pip install maturin[patchelf]
43
+ - name: Install dependencies
44
+ run: |
45
+ sudo add-apt-repository ppa:deadsnakes/ppa
46
+ sudo apt update
47
+ sudo apt install -y libssl-dev # OpenSSL development headers for Ubuntu
48
+ sudo apt install -y build-essential
49
+ sudo apt install -y pkg-config
50
+ sudo apt install python3.11 libpython3.11-dev
51
+ sudo apt install python3.9 libpython3.9-dev
52
+ sudo apt install python3.10 libpython3.11-dev
53
+ sudo apt install python3.12
54
+
55
+ - name: Set up Rust
56
+ uses: actions-rs/toolchain@v1
57
+ with:
58
+ profile: minimal
59
+ toolchain: nightly
60
+
61
+ - name: Install MKL
62
+ run: |
63
+ wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
64
+ echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
65
+ sudo apt update
66
+ sudo apt install -y intel-oneapi-mkl-devel
67
+ export LD_LIBRARY_PATH="/opt/intel/oneapi/compiler/2024.2/lib:$LD_LIBRARY_PATH"
68
+
69
+ - name: Build with Maturin
70
+ run: |
71
+ maturin build --release --out dist --find-interpreter --features mkl,extension-module
72
+ - name: Upload wheels
73
+ uses: actions/upload-artifact@v4
74
+ with:
75
+ name: wheels-linux-${{ matrix.platform.target }}
76
+ path: dist
77
+ windows:
78
+ runs-on: ${{ matrix.platform.runner }}
79
+ strategy:
80
+ matrix:
81
+ platform:
82
+ - runner: windows-latest
83
+ target: x64
84
+ steps:
85
+ - uses: actions/checkout@v4
86
+ - uses: actions/setup-python@v5
87
+ with:
88
+ python-version: 3.x
89
+ architecture: ${{ matrix.platform.target }}
90
+
91
+ - name: Build wheels
92
+ uses: PyO3/maturin-action@v1
93
+ with:
94
+ target: ${{ matrix.platform.target }}
95
+ args: --release --out dist --find-interpreter --features mkl,extension-module
96
+ sccache: 'true'
97
+ - name: Upload wheels
98
+ uses: actions/upload-artifact@v4
99
+ with:
100
+ name: wheels-windows-${{ matrix.platform.target }}
101
+ path: dist
102
+
103
+ macos:
104
+ runs-on: ${{ matrix.platform.runner }}
105
+ strategy:
106
+ matrix:
107
+ platform:
108
+ - runner: macos-12
109
+ target: x86_64
110
+ - runner: macos-14
111
+ target: aarch64
112
+ steps:
113
+ - uses: actions/checkout@v4
114
+ - uses: actions/setup-python@v5
115
+ with:
116
+ python-version: 3.x
117
+ - name: Build wheels
118
+ uses: PyO3/maturin-action@v1
119
+ with:
120
+ target: ${{ matrix.platform.target }}
121
+ args: --release --out dist --find-interpreter --features accelerate,extension-module
122
+ sccache: 'true'
123
+ - name: Upload wheels
124
+ uses: actions/upload-artifact@v4
125
+ with:
126
+ name: wheels-macos-${{ matrix.platform.target }}
127
+ path: dist
128
+
129
+ sdist:
130
+ runs-on: ubuntu-latest
131
+ steps:
132
+ - uses: actions/checkout@v4
133
+ - name: Build sdist
134
+ uses: PyO3/maturin-action@v1
135
+ with:
136
+ command: sdist
137
+ args: --out dist
138
+ - name: Upload sdist
139
+ uses: actions/upload-artifact@v4
140
+ with:
141
+ name: wheels-sdist
142
+ path: dist
143
+
144
+ release:
145
+ name: Release
146
+ runs-on: ubuntu-latest
147
+ if: "startsWith(github.ref, 'refs/tags/')"
148
+ permissions:
149
+ id-token: write
150
+ needs: [linux, windows, macos, sdist]
151
+ steps:
152
+ - uses: actions/download-artifact@v4
153
+ - name: Publish to PyPI
154
+ uses: PyO3/maturin-action@v1
155
+ with:
156
+ command: upload
157
+ args: --non-interactive --skip-existing wheels-*/*
@@ -0,0 +1,156 @@
1
+ # This file is autogenerated by maturin v1.7.0
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci github
5
+ #
6
+ name: CI_cuda
7
+
8
+ on:
9
+ push:
10
+ branches:
11
+ - main
12
+ - master
13
+ tags:
14
+ - '*'
15
+ pull_request:
16
+ workflow_dispatch:
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ linux:
23
+ runs-on: ${{ matrix.platform.runner }}
24
+ strategy:
25
+ matrix:
26
+ platform:
27
+ - runner: ubuntu-latest
28
+ target: x86_64
29
+
30
+ steps:
31
+ - name: Checkout code
32
+ uses: actions/checkout@v4
33
+
34
+
35
+ - name: Set up Python
36
+ uses: actions/setup-python@v5
37
+ with:
38
+ python-version: '>=3.10' # Choose the Python version you need
39
+
40
+ - name: Install Maturin
41
+ run: |
42
+ python3 -m pip install maturin[patchelf]
43
+ - name: Install dependencies
44
+ run: |
45
+ sudo add-apt-repository ppa:deadsnakes/ppa
46
+ sudo apt update
47
+ sudo apt install -y libssl-dev # OpenSSL development headers for Ubuntu
48
+ sudo apt install -y build-essential
49
+ sudo apt install -y pkg-config
50
+ sudo apt install python3.11 libpython3.11-dev
51
+ sudo apt install python3.9 libpython3.9-dev
52
+ sudo apt install python3.10 libpython3.11-dev
53
+ sudo apt install python3.12
54
+
55
+ - name: Set up Rust
56
+ uses: actions-rs/toolchain@v1
57
+ with:
58
+ profile: minimal
59
+ toolchain: nightly
60
+
61
+ - name: Install MKL
62
+ run: |
63
+ wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
64
+ echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
65
+ sudo apt update
66
+ sudo apt install -y intel-oneapi-mkl-devel
67
+ export LD_LIBRARY_PATH="/opt/intel/oneapi/compiler/2024.2/lib:$LD_LIBRARY_PATH"
68
+
69
+ - name: Build with Maturin
70
+ run: |
71
+ maturin build --release --out dist --find-interpreter --features mkl,extension-module
72
+ - name: Upload wheels
73
+ uses: actions/upload-artifact@v4
74
+ with:
75
+ name: wheels-linux-${{ matrix.platform.target }}
76
+ path: dist
77
+ windows:
78
+ runs-on: ${{ matrix.platform.runner }}
79
+ strategy:
80
+ matrix:
81
+ platform:
82
+ - runner: windows-latest
83
+ target: x64
84
+ steps:
85
+ - uses: actions/checkout@v4
86
+ - uses: actions/setup-python@v5
87
+ with:
88
+ python-version: 3.x
89
+ architecture: ${{ matrix.platform.target }}
90
+
91
+ - name: Build wheels
92
+ uses: PyO3/maturin-action@v1
93
+ with:
94
+ target: ${{ matrix.platform.target }}
95
+ args: --release --out dist --find-interpreter --features mkl,extension-module
96
+ sccache: 'true'
97
+ - name: Upload wheels
98
+ uses: actions/upload-artifact@v4
99
+ with:
100
+ name: wheels-windows-${{ matrix.platform.target }}
101
+ path: dist
102
+
103
+ macos:
104
+ runs-on: ${{ matrix.platform.runner }}
105
+ strategy:
106
+ matrix:
107
+ platform:
108
+ - runner: macos-12
109
+ target: x86_64
110
+ - runner: macos-14
111
+ target: aarch64
112
+ steps:
113
+ - uses: actions/checkout@v4
114
+ - uses: actions/setup-python@v5
115
+ with:
116
+ python-version: 3.x
117
+ - name: Build wheels
118
+ uses: PyO3/maturin-action@v1
119
+ with:
120
+ target: ${{ matrix.platform.target }}
121
+ args: --release --out dist --find-interpreter --features accelerate,extension-module
122
+ sccache: 'true'
123
+ - name: Upload wheels
124
+ uses: actions/upload-artifact@v4
125
+ with:
126
+ name: wheels-macos-${{ matrix.platform.target }}
127
+ path: dist
128
+
129
+ sdist:
130
+ runs-on: ubuntu-latest
131
+ steps:
132
+ - uses: actions/checkout@v4
133
+ - name: Build sdist
134
+ uses: PyO3/maturin-action@v1
135
+ with:
136
+ command: sdist
137
+ args: --out dist
138
+ - name: Upload sdist
139
+ uses: actions/upload-artifact@v4
140
+ with:
141
+ name: wheels-sdist
142
+ path: dist
143
+
144
+ release:
145
+ name: Release
146
+ runs-on: ubuntu-latest
147
+ permissions:
148
+ id-token: write
149
+ needs: [linux, windows, macos, sdist]
150
+ steps:
151
+ - uses: actions/download-artifact@v4
152
+ - name: Publish to PyPI
153
+ uses: PyO3/maturin-action@v1
154
+ with:
155
+ command: upload
156
+ args: --non-interactive --skip-existing wheels-*/*
@@ -0,0 +1,42 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+ tags:
9
+ - '*'
10
+ pull_request:
11
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: write
15
+
16
+ jobs:
17
+ deploy:
18
+ runs-on: ${{ matrix.platform.runner }}
19
+ strategy:
20
+ matrix:
21
+ platform:
22
+ - runner: ubuntu-latest
23
+ target: x86_64
24
+
25
+ steps:
26
+ - name: Checkout code
27
+ uses: actions/checkout@v4
28
+ - name: Configure Git Credentials
29
+ run: |
30
+ git config user.name github-actions[bot]
31
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
32
+
33
+ - name: Set up Python
34
+ uses: actions/setup-python@v5
35
+ with:
36
+ python-version: '3.x' # Choose the Python version you need
37
+ - name: Deploy Docs
38
+ run: |
39
+ pip install mkdocs mkdocstrings[python] mkdocs-material
40
+ mkdocs build
41
+ mkdocs gh-deploy --force
42
+
@@ -0,0 +1,73 @@
1
+ /target
2
+
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ .pytest_cache/
6
+ *.py[cod]
7
+
8
+ # C extensions
9
+ embed*.so
10
+
11
+ # Distribution / packaging
12
+ .Python
13
+ .venv/
14
+ env/
15
+ bin/
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ eggs/
20
+ lib64/
21
+ parts/
22
+ sdist/
23
+ var/
24
+ include/
25
+ man/
26
+ venv/
27
+ *.egg-info/
28
+ .installed.cfg
29
+ *.egg
30
+
31
+ # Installer logs
32
+ pip-log.txt
33
+ pip-delete-this-directory.txt
34
+ pip-selfcheck.json
35
+
36
+ # Unit test / coverage reports
37
+ htmlcov/
38
+ .tox/
39
+ .coverage
40
+ .cache
41
+ nosetests.xml
42
+ coverage.xml
43
+
44
+ # Translations
45
+ *.mo
46
+
47
+ # Mr Developer
48
+ .mr.developer.cfg
49
+ .project
50
+ .pydevproject
51
+
52
+ # Rope
53
+ .ropeproject
54
+
55
+ # Django stuff:
56
+ *.log
57
+ *.pot
58
+
59
+ .DS_Store
60
+
61
+ # Sphinx documentation
62
+ docs/_build/
63
+
64
+ # PyCharm
65
+ .idea/
66
+
67
+ # VSCode
68
+ .vscode/
69
+
70
+ # Pyenv
71
+ .python-version
72
+
73
+