Automatically detect model list
This commit is contained in:
@@ -38,7 +38,7 @@ from api.schema import (
|
|||||||
Embedding,
|
Embedding,
|
||||||
|
|
||||||
)
|
)
|
||||||
from api.setting import DEBUG, AWS_REGION, ENABLE_CROSS_REGION_INFERENCE
|
from api.setting import DEBUG, AWS_REGION, ENABLE_CROSS_REGION_INFERENCE, DEFAULT_MODEL
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -126,6 +126,12 @@ def list_bedrock_models() -> dict:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Unable to list models: {str(e)}")
|
logger.error(f"Unable to list models: {str(e)}")
|
||||||
|
|
||||||
|
if not model_list:
|
||||||
|
# In case stack not updated.
|
||||||
|
model_list[DEFAULT_MODEL] = {
|
||||||
|
'modalities': ["TEXT", "IMAGE"]
|
||||||
|
}
|
||||||
|
|
||||||
return model_list
|
return model_list
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user