Skip to content

Commit

Permalink
Removes model_parameters, which were redundant with provider_params, …
Browse files Browse the repository at this point in the history
…from chat and completion code
  • Loading branch information
JasonWeill committed Feb 7, 2024
1 parent 7b8e314 commit e8d178d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def __init__(self, retriever, *args, **kwargs):
def create_llm_chain(
self, provider: Type[BaseProvider], provider_params: Dict[str, str]
):
model_parameters = self.get_model_parameters(provider, provider_params)
self.llm = provider(**provider_params, **model_parameters)
self.llm = provider(**provider_params)
memory = ConversationBufferWindowMemory(
memory_key="chat_history", return_messages=True, k=2
)
Expand Down
3 changes: 1 addition & 2 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ def __init__(self, *args, **kwargs):
def create_llm_chain(
self, provider: Type[BaseProvider], provider_params: Dict[str, str]
):
model_parameters = self.get_model_parameters(provider, provider_params)
llm = provider(**provider_params, **model_parameters)
llm = provider(**provider_params)

prompt_template = llm.get_chat_prompt_template()
self.memory = ConversationBufferWindowMemory(
Expand Down
3 changes: 1 addition & 2 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ def __init__(self, preferred_dir: str, log_dir: Optional[str], *args, **kwargs):
def create_llm_chain(
self, provider: Type[BaseProvider], provider_params: Dict[str, str]
):
model_parameters = self.get_model_parameters(provider, provider_params)
llm = provider(**provider_params, **model_parameters)
llm = provider(**provider_params)

self.llm = llm
return llm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ def __init__(self, *args, **kwargs):
def create_llm_chain(
self, provider: Type[BaseProvider], provider_params: Dict[str, str]
):
model_parameters = self.get_model_parameters(provider, provider_params)
llm = provider(**provider_params, **model_parameters)
llm = provider(**provider_params)

prompt_template = llm.get_completion_prompt_template()

Expand Down

0 comments on commit e8d178d

Please sign in to comment.