Skip to content
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

Fix LLM types so that they can be loaded from config dicts #6235

Merged
merged 1 commit into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions langchain/llms/aleph_alpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AlephAlpha(LLM):
.. code-block:: python

from langchain.llms import AlephAlpha
alpeh_alpha = AlephAlpha(aleph_alpha_api_key="my-api-key")
aleph_alpha = AlephAlpha(aleph_alpha_api_key="my-api-key")
"""

client: Any #: :meta private:
Expand Down Expand Up @@ -199,7 +199,7 @@ def _identifying_params(self) -> Dict[str, Any]:
@property
def _llm_type(self) -> str:
"""Return type of llm."""
return "alpeh_alpha"
return "aleph_alpha"

def _call(
self,
Expand All @@ -220,7 +220,7 @@ def _call(
Example:
.. code-block:: python

response = alpeh_alpha("Tell me a joke.")
response = aleph_alpha("Tell me a joke.")
"""
from aleph_alpha_client import CompletionRequest, Prompt

Expand Down
2 changes: 1 addition & 1 deletion langchain/llms/bananadev.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _identifying_params(self) -> Mapping[str, Any]:
@property
def _llm_type(self) -> str:
"""Return type of llm."""
return "banana"
return "bananadev"

def _call(
self,
Expand Down
2 changes: 1 addition & 1 deletion langchain/llms/huggingface_text_gen_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def validate_environment(cls, values: Dict) -> Dict:
@property
def _llm_type(self) -> str:
"""Return type of llm."""
return "hf_textgen_inference"
return "huggingface_textgen_inference"

def _call(
self,
Expand Down
2 changes: 1 addition & 1 deletion langchain/llms/llamacpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _identifying_params(self) -> Dict[str, Any]:
@property
def _llm_type(self) -> str:
"""Return type of llm."""
return "llama.cpp"
return "llamacpp"

def _get_parameters(self, stop: Optional[List[str]] = None) -> Dict[str, Any]:
"""
Expand Down
2 changes: 1 addition & 1 deletion langchain/llms/mosaicml.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _identifying_params(self) -> Mapping[str, Any]:
@property
def _llm_type(self) -> str:
"""Return type of llm."""
return "mosaicml"
return "mosaic"

def _transform_prompt(self, prompt: str) -> str:
"""Transform prompt."""
Expand Down
2 changes: 1 addition & 1 deletion langchain/llms/rwkv.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _identifying_params(self) -> Mapping[str, Any]:
@property
def _llm_type(self) -> str:
"""Return the type of llm."""
return "rwkv-4"
return "rwkv"

def run_rnn(self, _tokens: List[str], newline_adj: int = 0) -> Any:
AVOID_REPEAT_TOKENS = []
Expand Down