-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(learn): modernize 00-fine-tuning.ipynb and chains.py to Pinecone SDK v8 #535
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jhamon
wants to merge
11
commits into
master
Choose a base branch
from
jhamon/sdk-174-modernize-sdk-00-fine-tuningipynb
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
…DK v8 - Replace pinecone-client with pinecone>=7.0.0 in notebook - Update chains.py: Pinecone(api_key=...), ServerlessSpec, create_index with dimension/spec - Add intro markdown, prerequisites, Colab/nbviewer badges - Use getpass fallback for Pinecone API key per review template - Align metadata key in build_index with query (text) - Clear notebook outputs for valid nbformat Linear: SDK-174
- Split first notebook cell: download chains.py then imports (fix E402) - Sort imports in notebook and chains.py (fix I001) - Use 'is not None' instead of '!= None' (fix E711)
- Move imports into first code cell per notebook guidelines - Add noqa: E402 for imports after chains.py download (required order)
- chains.py: use environment param for ServerlessSpec region instead of hardcoding - 00-fine-tuning.ipynb: run pip install before imports so Colab runs correctly
Merge pip install, chains.py download, and all imports into the first code cell to satisfy check-structure (imports in first code cell). Pin requests==2.32.3 for reproducibility.
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Addresses Bugbot: pip install must run first so packages are available before importing on a fresh Colab environment. Co-authored-by: Cursor <[email protected]>
The run-notebook converter puts cells containing !pip entirely in run.sh and excludes them from the Python script. The first cell mixed pip install with imports and chains.py download, so the script never got the imports. Split into two cells: pip only, then imports and chains download. Co-authored-by: Cursor <[email protected]>
eb5ddfd to
5823593
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Updates
learn/generation/openai/fine-tuning/gpt-3.5-agent-training/00-fine-tuning.ipynband thechains.pyhelper to use Pinecone Python SDK v8 instead ofpinecone-client.What this accomplishes
Pinecone(api_key),pc.Index(name=...)).PINECONE_API_KEYenv or getpass fallback.region/cloud(serverless) instead of legacyenvironment.Audience / use case
Developers following the GPT-3.5 fine-tuning + retrieval example who need to run it with the current Pinecone SDK.
Prerequisites
pinecone>=5.0.0(replacespinecone-client)Key changes
pinecone-client==2.2.2→pinecone>=5.0.0; VectorDBChain instantiation usespinecone_api_key,region,cloudwith getpass fallback for API key.Pinecone(api_key),ServerlessSpec,create_index(name=..., dimension=1536, metric=..., spec=spec),pc.Index(name=...); query response handling compatible with v8.Linear
Note
Medium Risk
Medium risk because it changes the Pinecone integration and index creation semantics (serverless
ServerlessSpec, metadata shape, and region/env handling), which could break the notebook if assumptions don’t match the user’s Pinecone setup.Overview
Modernizes the
gpt-3.5-agent-trainingfine-tuning notebook to run with current dependencies, including switching frompinecone-clienttopinecone==8.0.0, adding a short intro/prerequisites section, and prompting forPINECONE_API_KEY(env orgetpass) while defaulting the Pinecone region.Updates
chains.pyto use the Pinecone SDK v8 API (Pinecone(api_key), serverless index creation viaServerlessSpec, explicit embedding dimension), and aligns stored/queryable metadata to use thetextfield so retrieval works with the updated query response shape.Written by Cursor Bugbot for commit 5823593. This will update automatically on new commits. Configure here.