Skip to content

Overwrite default prompts #3

Open
@jhgoebbert

Description

Define better prompts for certain models (eg. Starcoder2) instead of using the default ones.

For this classmethods of BaseProvider must be overwritten:

  • def update_prompt_template(self, format: str, template: str):
  • def get_prompt_template(self, format) -> PromptTemplate:
  • def get_chat_prompt_template(self) -> PromptTemplate:
  • def get_completion_prompt_template(self) -> PromptTemplate:

Details here: https://github.com/jupyterlab/jupyter-ai/blob/v2.20.0/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py#L366

Example:
TogetherAIProvider(BaseProvider, Together) -> def get_prompt_template(self, format) -> PromptTemplate:
https://github.com/jupyterlab/jupyter-ai/blob/v2.20.0/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py#L736

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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