Skip to content

Commit

Permalink
Add mistral provider 7b
Browse files Browse the repository at this point in the history
  • Loading branch information
sansmoraxz committed Mar 16, 2024
1 parent 0e7d668 commit c52a30a
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
"anthropic.claude-3-haiku-20240307-v1:0": 200000,
"meta.llama2-13b-chat-v1": 2048,
"meta.llama2-70b-chat-v1": 4096,
"mistral.mistral-7b-instruct-v0:2": 32000,
"mistral.mixtral-8x7b-instruct-v0:1": 32000,
}
BEDROCK_FOUNDATION_LLMS = {**COMPLETION_MODELS, **CHAT_ONLY_MODELS}

Expand All @@ -64,6 +66,8 @@
"anthropic.claude-3-sonnet-20240229-v1:0",
"anthropic.claude-3-haiku-20240307-v1:0",
"meta.llama2-13b-chat-v1",
"mistral.mistral-7b-instruct-v0:2",
"mistral.mixtral-8x7b-instruct-v0:1",
}


Expand Down Expand Up @@ -178,12 +182,24 @@ def get_text_from_response(self, response: dict) -> str:
return response["generation"]


class MistralProvider(Provider):
max_tokens_key = "max_tokens"

def __init__(self) -> None:
self.messages_to_prompt = messages_to_llama_prompt
self.completion_to_prompt = completion_to_llama_prompt

def get_text_from_response(self, response: dict) -> str:
return response["outputs"][0]["text"]


PROVIDERS = {
"amazon": AmazonProvider(),
"ai21": Ai21Provider(),
"anthropic": AnthropicProvider(),
"cohere": CohereProvider(),
"meta": MetaProvider(),
"mistral": MistralProvider(),
}


Expand Down

0 comments on commit c52a30a

Please sign in to comment.