Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Make transformers optional + allow pinecone-text[dense] #266

Merged
merged 11 commits into from
Jan 28, 2024

Conversation

igiloh-pinecone
Copy link
Contributor

Problem

  1. transformers shouldn't be a required dependency. It was accidentally added as such.
  2. No way to install pinecone-text with its [dense] extra dependency

Solution

  1. Made transformers optional, only installed with a new anyscale extra
  2. Added a new torch extra (torch is the heaviest installation, so it made more sense as the extra's name than transformers or sentence-transformers, which might be ambiguous)

Type of Change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Might be slightly breaking for users who currently use the Anyscale Tokenizer, and would need to re-install with the extra.

Test Plan

No affect on current tests

…t[dense]

1. `transformers` shouldn't be a required dependency. It was accidentaly added as such.
2. Added option to intall pinecone-text with dense dependency, under a new extra named `torch` (feels like the right name, since this is the heaviest dependency).
Copy link
Contributor

@acatav acatav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added few questions

pyproject.toml Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
Now that I made `transformers` optional, needed to add error handling so it won't crash on import
Copy link
Contributor

@acatav acatav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@igiloh-pinecone igiloh-pinecone added this pull request to the merge queue Jan 25, 2024
@igiloh-pinecone igiloh-pinecone removed this pull request from the merge queue due to a manual request Jan 25, 2024
@@ -9,6 +9,10 @@ inputs:
description: "Whether to install canopy library, or dependencies only"
required: true
default: "true"
extras:
description: "Extra dependencies to install"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should explain it is space separated

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a list also is an option

@@ -37,8 +41,12 @@ runs:
- name: Install dependencies
shell: bash
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --all-extras --with dev
env:
Copy link
Collaborator

@izellevy izellevy Jan 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need --with dev? By default it is with dev isnt it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure, and I prefer to be explicit...

Improve the text description of the new `Extras` field
src/canopy_cli/cli.py Outdated Show resolved Hide resolved
@igiloh-pinecone igiloh-pinecone added this pull request to the merge queue Jan 28, 2024
Merged via the queue into pinecone-io:main with commit b365b2c Jan 28, 2024
7 checks passed
@igiloh-pinecone igiloh-pinecone deleted the tranformers_optional branch January 28, 2024 15:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants