-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(docs): modernize 00-fine-tuning.ipynb and chains.py to Pinecone SDK v8 #536
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
base: master
Are you sure you want to change the base?
Conversation
…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
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
learn/generation/openai/fine-tuning/gpt-3.5-agent-training/chains.py
Outdated
Show resolved
Hide resolved
learn/generation/openai/fine-tuning/gpt-3.5-agent-training/00-fine-tuning.ipynb
Outdated
Show resolved
Hide resolved
- 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)
bf186d8 to
d5f9614
Compare
- chains.py: use environment param for ServerlessSpec region instead of hardcoding - 00-fine-tuning.ipynb: run pip install before imports so Colab runs correctly
|
Addressed both Bugbot findings:
Pushed in fa45214. |
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]>
|
Addressed Bugbot feedback:
|
…ine-tuning.ipynb Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| ], | ||
| "execution_count": null, | ||
| "outputs": [] | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate placeholder cells accidentally committed
Low Severity
The notebook contains two identical code cells that only contain the comment # Setup complete (imports and chains.py in previous cell). These duplicate placeholder cells appear to be leftover from editing and serve no purpose. According to the review rules, notebooks should flow logically with clear structure, and these redundant cells clutter the notebook without adding value.
Summary
Modernizes
learn/generation/openai/fine-tuning/gpt-3.5-agent-training/00-fine-tuning.ipynbandchains.pyto use Pinecone SDK v8 (Linear SDK-174).Changes
pinecone-client==2.2.2withpinecone>=7.0.0; add intro markdown, prerequisites, Colab/nbviewer badges; usegetpassfallback for Pinecone API key per review template; clear outputs for valid nbformat.Pinecone(api_key=...),ServerlessSpec(cloud="aws", region="us-east-1"),create_indexwithdimension=1536andspec; alignbuild_indexmetadata key withquery(text).Audience / use case
Developers fine-tuning GPT-3.5 with a Pinecone-backed retrieval tool.
Prerequisites
OpenAI API key, Pinecone API key;
datasets,langchain,pinecone,openai(see notebook).Related
Note
Medium Risk
Moderate risk because it changes the Pinecone client initialization and index-creation parameters (serverless spec/region and embedding dimension), which could break the example if misconfigured or if users’ environments differ.
Overview
Modernizes the
00-fine-tuning.ipynbexample by adding an intro/prereqs section and Colab/nbviewer badges, updating installs topinecone==8.0.0(plusrequests), and switching Pinecone API key handling to an env-var-or-getpassflow; it also clears cell outputs/exec counts for a cleaner notebook.Migrates
chains.pyto Pinecone SDK v8 by replacing legacypinecone.init/Indexusage withPinecone(api_key=...)+ServerlessSpecindex creation (explicitdimension=1536), and aligns stored metadata to use thetextkey soquery()returns the expected field.Written by Cursor Bugbot for commit 26fbf7a. This will update automatically on new commits. Configure here.