mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 07:14:20 +00:00
Cleanup
This commit is contained in:
parent
1702aa5e3f
commit
6d8f59e359
3 changed files with 6 additions and 11 deletions
|
@ -18,7 +18,7 @@ from llama_stack.providers.utils.inference.routable import RoutableProviderForMo
|
||||||
from llama_stack.apis.inference import * # noqa: F403
|
from llama_stack.apis.inference import * # noqa: F403
|
||||||
from llama_stack.providers.adapters.inference.bedrock.config import BedrockConfig
|
from llama_stack.providers.adapters.inference.bedrock.config import BedrockConfig
|
||||||
|
|
||||||
# mapping of Model SKUs to ollama models
|
|
||||||
BEDROCK_SUPPORTED_MODELS = {
|
BEDROCK_SUPPORTED_MODELS = {
|
||||||
"Llama3.1-8B-Instruct": "meta.llama3-1-8b-instruct-v1:0",
|
"Llama3.1-8B-Instruct": "meta.llama3-1-8b-instruct-v1:0",
|
||||||
"Llama3.1-70B-Instruct": "meta.llama3-1-70b-instruct-v1:0",
|
"Llama3.1-70B-Instruct": "meta.llama3-1-70b-instruct-v1:0",
|
||||||
|
|
|
@ -22,6 +22,7 @@ from llama_stack.providers.utils.inference.augment_messages import (
|
||||||
|
|
||||||
from .config import FireworksImplConfig
|
from .config import FireworksImplConfig
|
||||||
|
|
||||||
|
|
||||||
FIREWORKS_SUPPORTED_MODELS = {
|
FIREWORKS_SUPPORTED_MODELS = {
|
||||||
"Llama3.1-8B-Instruct": "fireworks/llama-v3p1-8b-instruct",
|
"Llama3.1-8B-Instruct": "fireworks/llama-v3p1-8b-instruct",
|
||||||
"Llama3.1-70B-Instruct": "fireworks/llama-v3p1-70b-instruct",
|
"Llama3.1-70B-Instruct": "fireworks/llama-v3p1-70b-instruct",
|
||||||
|
|
|
@ -22,6 +22,7 @@ from llama_stack.providers.utils.inference.routable import RoutableProviderForMo
|
||||||
|
|
||||||
from .config import TogetherImplConfig
|
from .config import TogetherImplConfig
|
||||||
|
|
||||||
|
|
||||||
TOGETHER_SUPPORTED_MODELS = {
|
TOGETHER_SUPPORTED_MODELS = {
|
||||||
"Llama3.1-8B-Instruct": "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
|
"Llama3.1-8B-Instruct": "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
|
||||||
"Llama3.1-70B-Instruct": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
|
"Llama3.1-70B-Instruct": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
|
||||||
|
@ -167,17 +168,10 @@ class TogetherInferenceAdapter(
|
||||||
stream=True,
|
stream=True,
|
||||||
**options,
|
**options,
|
||||||
):
|
):
|
||||||
if chunk.choices[0].finish_reason:
|
if finish_reason := chunk.choices[0].finish_reason:
|
||||||
if (
|
if stop_reason is None and finish_reason in ["stop", "eos"]:
|
||||||
stop_reason is None and chunk.choices[0].finish_reason == "stop"
|
|
||||||
) or (
|
|
||||||
stop_reason is None and chunk.choices[0].finish_reason == "eos"
|
|
||||||
):
|
|
||||||
stop_reason = StopReason.end_of_turn
|
stop_reason = StopReason.end_of_turn
|
||||||
elif (
|
elif stop_reason is None and finish_reason == "length":
|
||||||
stop_reason is None
|
|
||||||
and chunk.choices[0].finish_reason == "length"
|
|
||||||
):
|
|
||||||
stop_reason = StopReason.out_of_tokens
|
stop_reason = StopReason.out_of_tokens
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue