Skip to content

BootstrapFewShot failing due to lm.copy for AzureOpenAI #591

@insop

Description

@insop

Since #521 is closed state, creating a new issue.

Now, the initial PR #522 for the issue was reverted by this PR, #584 recently, I think we need to keep this issue.


BootstrapFewShot failing due to lm.copy for AzureOpenAI, likely due to positional argument issue from recent changes.

Environment

Error message

  • during BootstrapFewShot run, code errored out due to missing arguments, api_version
>[dspy/dsp/modules/lm.py](https://file+.vscode-resource.vscode-cdn.net/Users/insop/Projects/Github/NLP/dspy/dsp/modules/lm.py)(106)copy()
    102         model = kwargs.pop('model')
    105
--> 106         return self.__class__(model, **kwargs)

Changes

AzureOpenAI expects positional arguments, so it is failing. I am putting my change for review if that will impact other models.

class AzureOpenAI(LM):
...

    def __init__(
        self,
        api_base: str,
        api_version: str,
        model: str = "gpt-3.5-turbo-instruct",
        api_key: Optional[str] = None,
        model_type: Literal["chat", "text"] = "chat",
        **kwargs,
    ):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions