- Notifications
You must be signed in to change notification settings - Fork328
Reorganized the SDK directory#954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
16 commits Select commitHold shift + click to select a range
f9a1ce2
Some updates to text
SilasMarvinb47dc45
Massive updates to structure and renaming of pgml-macros
SilasMarvin4dd527e
Small updats to README
SilasMarvinfb67696
Small test cleanup
SilasMarvina018637
Typo fix
SilasMarvinfe5ba1b
Added examples directory and README
SilasMarvina852681
Updated javascript examples a bit
SilasMarvin052f51a
Slight rewording on README
SilasMarvin681aa8b
Updated workflows to set new env variables for build
SilasMarvin20123f5
Updated manual build to set new env variable for build
SilasMarvinc0fc80d
Link fix on README
SilasMarvin3ec48c3
Link fix on README
SilasMarvin6813b34
Link fix on README
SilasMarvin04f4ea0
Link fix on README
SilasMarvin59aa1e9
Updated README and added requirements.txt
SilasMarvin4152866
Fix python README demo to actually work
SilasMarvinFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletions.github/workflows/javascript-sdk.yml
This file contains hidden or 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
6 changes: 6 additions & 0 deletions.github/workflows/python-sdk.yml
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
37 changes: 26 additions & 11 deletionspgml-sdks/rust/pgml/Cargo.lock → pgml-sdks/pgml/Cargo.lock
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
7 changes: 6 additions & 1 deletionpgml-sdks/rust/pgml/Cargo.toml → pgml-sdks/pgml/Cargo.toml
This file contains hidden or 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
14 changes: 14 additions & 0 deletionspgml-sdks/pgml/README.md
This file contains hidden or 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,14 @@ | ||
# Open Source Alternative for Building End-to-End Vector Search Applications without OpenAI & Pinecone | ||
# Suported Languages | ||
We support a number of different languages: | ||
- [Python](python) | ||
- [JavaScript](javascript) | ||
- [Rust](#rust) | ||
Our SDK is written completely in Rust and translated by Rust to our other supported languages. See each individual language for an overview and specification on how to use the SDK. | ||
# Rust | ||
More information about our methodologies and Rust SDK coming soon. |
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletionspgml-sdks/rust/pgml/javascript/README.md → pgml-sdks/pgml/javascript/README.md
This file contains hidden or 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
21 changes: 15 additions & 6 deletions...s/rust/pgml/javascript/examples/README.md → pgml-sdks/pgml/javascript/examples/README.md
This file contains hidden or 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,16 +1,25 @@ | ||
# Examples | ||
## Prerequisites | ||
Before running any examples first install dependencies and set the DATABASE_URL environment variable: | ||
``` | ||
npm i | ||
export DATABASE_URL={YOUR DATABASE URL} | ||
``` | ||
Optionally, configure a .env file containing a DATABASE_URL variable. | ||
## [Semantic Search](./semantic_search.js) | ||
This is a basic example to perform semantic search on a collection of documents. Embeddings are created using `intfloat/e5-small` model. The results are semantically similar documemts to the query. Finally, the collection is archived. | ||
## [Question Answering](./question_answering.js) | ||
This is an example to find documents relevant to a question from the collection of documents. The query is passed to vector search to retrieve documents that match closely in the embeddings space. A score is returned with each of the search result. | ||
## [Question Answering using Instructore Model](./question_answering_instructor.js) | ||
In this example, we will use `hknlp/instructor-base` model to build text embeddings instead of the default `intfloat/e5-small` model. | ||
## [Extractive Question Answering](./extractive_question_answering.js) | ||
In this example, we will show how to use `vector_recall` result as a `context` to a HuggingFace question answering model. We will use `Builtins.transform()` to run the model on the database. | ||
## [Summarizing Question Answering](./summarizing_question_answering.js) | ||
This is an example to find documents relevant to a question from the collection of documents and then summarize those documents. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 2 additions & 4 deletionspgml-sdks/rust/pgml/python/README.md → pgml-sdks/pgml/python/README.md
This file contains hidden or 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
26 changes: 17 additions & 9 deletions...-sdks/rust/pgml/python/examples/README.md → pgml-sdks/pgml/python/examples/README.md
This file contains hidden or 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,20 +1,28 @@ | ||
# Examples | ||
## Prerequisites | ||
Before running any examples first install dependencies and set the DATABASE_URL environment variable: | ||
``` | ||
pip install -r requirements.txt | ||
export DATABASE_URL={YOUR DATABASE URL} | ||
``` | ||
Optionally, configure a .env file containing a DATABASE_URL variable. | ||
## [Semantic Search](./semantic_search.py) | ||
This is a basic example to perform semantic search on a collection of documents. It loads the Quora dataset, creates a collection in a PostgreSQL database, upserts documents, generates chunks and embeddings, and then performs a vector search on a query. Embeddings are created using `intfloat/e5-small` model. The results are semantically similar documemts to the query. Finally, the collection is archived. | ||
## [Question Answering](./question_answering.py) | ||
This is an example to find documents relevant to a question from the collection of documents. It loads the Stanford Question Answering Dataset (SQuAD) into the database, generates chunks and embeddings. Query is passed to vector search to retrieve documents that match closely in the embeddings space. A score is returned with each of the search result. | ||
## [Question Answering using Instructore Model](./question_answering_instructor.py) | ||
In this example, we will use `hknlp/instructor-base` model to build text embeddings instead of the default `intfloat/e5-small` model. | ||
## [Extractive Question Answering](./extractive_question_answering.py) | ||
In this example, we will show how to use `vector_recall` result as a `context` to a HuggingFace question answering model. We will use `Builtins.transform()` to run the model on the database. | ||
## [Table Question Answering](./table_question_answering.py) | ||
In this example, we will use [Open Table-and-Text Question Answering (OTT-QA)](https://github.com/wenhuchen/OTT-QA) dataset to run queries on tables. We will use `deepset/all-mpnet-base-v2-table` model that is trained for embedding tabular data for retrieval tasks. | ||
## [Summarizing Question Answering](./summarizing_question_answering.py) | ||
This is an example to find documents relevant to a question from the collection of documents and then summarize those documents. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletionspgml-sdks/pgml/python/examples/requirements.txt
This file contains hidden or 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,36 @@ | ||
aiohttp==3.8.5 | ||
aiosignal==1.3.1 | ||
async-timeout==4.0.3 | ||
attrs==23.1.0 | ||
certifi==2023.7.22 | ||
charset-normalizer==3.2.0 | ||
datasets==2.14.4 | ||
dill==0.3.7 | ||
filelock==3.12.3 | ||
frozenlist==1.4.0 | ||
fsspec==2023.6.0 | ||
huggingface-hub==0.16.4 | ||
idna==3.4 | ||
markdown-it-py==3.0.0 | ||
mdurl==0.1.2 | ||
multidict==6.0.4 | ||
multiprocess==0.70.15 | ||
numpy==1.25.2 | ||
packaging==23.1 | ||
pandas==2.0.3 | ||
pgml==0.9.0 | ||
pyarrow==13.0.0 | ||
Pygments==2.16.1 | ||
python-dateutil==2.8.2 | ||
python-dotenv==1.0.0 | ||
pytz==2023.3 | ||
PyYAML==6.0.1 | ||
requests==2.31.0 | ||
rich==13.5.2 | ||
six==1.16.0 | ||
tqdm==4.66.1 | ||
typing_extensions==4.7.1 | ||
tzdata==2023.3 | ||
urllib3==2.0.4 | ||
xxhash==3.3.0 | ||
yarl==1.9.2 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletionspgml-sdks/pgml/python/manual-build-deploy.sh
This file contains hidden or 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,6 @@ | ||
#!/bin/bash | ||
echo "Make sure and set the environment variable MATURIN_PYPI_TOKEN to your PyPI token." | ||
cd .. | ||
PYTHON_STUB_FILE="python/pgml/pgml.pyi" maturin publish -r $1 -i python3.8 -i python3.9 -i python3.10 -i python3.11 --skip-existing -F python |
File renamed without changes.
5 changes: 5 additions & 0 deletionspgml-sdks/pgml/python/pgml/pgml.pyi
This file contains hidden or 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,5 @@ | ||
def py_init_logger(level: Optional[str] = "", format: Optional[str] = "") -> None | ||
Json = Any | ||
DateTime = int |
File renamed without changes.
11 changes: 5 additions & 6 deletionspgml-sdks/rust/pgml/src/builtins.rs → pgml-sdks/pgml/src/builtins.rs
This file contains hidden or 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
14 changes: 4 additions & 10 deletionspgml-sdks/rust/pgml/src/collection.rs → pgml-sdks/pgml/src/collection.rs
This file contains hidden or 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
4 changes: 2 additions & 2 deletionspgml-sdks/rust/pgml/src/filter_builder.rs → pgml-sdks/pgml/src/filter_builder.rs
This file contains hidden or 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
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.