-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Added support for models on AWS Bedrock and Sagemaker #795
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
Conversation
…ker) and models (mistral, anthropic, meta)
…d sagemaker) and models (mistral, anthropic, meta)" This reverts commit 3477491.
…ker) and models (mistral, anthropic, meta)
|
@arnavsinghvi11 - Thanks for the review! I have updated all the code per your review comments. Notes
|
|
ChainOfThought.forward is throwing error due to num_generations being removed in AWSAnthropic at following line: Here's the full stack traceTypeError Traceback (most recent call last) File /opt/conda/lib/python3.10/site-packages/dspy/predict/predict.py:49, in Predict.call(self, **kwargs) File /opt/conda/lib/python3.10/site-packages/dspy/predict/chain_of_thought.py:59, in ChainOfThought.forward(self, **kwargs) File /opt/conda/lib/python3.10/site-packages/dspy/predict/predict.py:70, in Predict.forward(self, **kwargs) TypeError: '>' not supported between instances of 'NoneType' and 'int' |
|
@sachinkun21 - can you get the latest code for the PR and doublecheck that aws_models.py contains below code? |
|
Thanks @drawal1 ! looks great! just left a few minor comments but should be good to merge after that. |
…ctor and is for bedrock only
|
@arnavsinghvi11 - Should be ready to merge now, hopefully :) |
|
Thanks @drawal1 ! looks great now. Just a small thing before I merge. Could you add some further documentation for AWSProvider? Missed flagging this in earlier comments but something similar to what's done for AWSMistral and add it for an example AWSProvider like Bedrock |
…files. Updated docs in aws_providers.py
|
@arnavsinghvi11 - AWSProvider is now documented as well |
|
Thanks for all the contributions @drawal1! |
@drawal1 it seems like num_generations is being set to None automatically if "n" and "num_generations" doesn't exist in kwargs, which causes the error in this line: One potential fix is changing this to |
|
@mikeusru - what aws provider and model are you using? can you share a code snippet so I can repro? |
|
Using Bedrock and claude3-haiku Error: The error is fixed when the change I posted earlier is introduced |
|
@mikeusru - good catch! I agree with your solution. Do you want to submit a PR? Otherwise, I can do it |
I suppose I can submit the PR - my first ever on github :D |
Supported model families: Mistral, Anthropic, Meta
This replaced PR #772 which is closed. Code has been updated to satisfy review comments on PR #772 posted by @arnavsinghvi11