Signed-off-by: yihong0618 <zouzou0208@gmail.com>tags/0.12.1
| @@ -122,7 +122,7 @@ class GiteeAIRerankModel(RerankModel): | |||
| label=I18nObject(en_US=model), | |||
| model_type=ModelType.RERANK, | |||
| fetch_from=FetchFrom.CUSTOMIZABLE_MODEL, | |||
| model_properties={ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size"))}, | |||
| model_properties={ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size", 512))}, | |||
| ) | |||
| return entity | |||
| @@ -140,7 +140,7 @@ class GPUStackRerankModel(RerankModel): | |||
| label=I18nObject(en_US=model), | |||
| model_type=ModelType.RERANK, | |||
| fetch_from=FetchFrom.CUSTOMIZABLE_MODEL, | |||
| model_properties={ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size"))}, | |||
| model_properties={ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size", 512))}, | |||
| ) | |||
| return entity | |||
| @@ -128,7 +128,7 @@ class JinaRerankModel(RerankModel): | |||
| label=I18nObject(en_US=model), | |||
| model_type=ModelType.RERANK, | |||
| fetch_from=FetchFrom.CUSTOMIZABLE_MODEL, | |||
| model_properties={ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size"))}, | |||
| model_properties={ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size", 8000))}, | |||
| ) | |||
| return entity | |||
| @@ -193,7 +193,7 @@ class JinaTextEmbeddingModel(TextEmbeddingModel): | |||
| label=I18nObject(en_US=model), | |||
| model_type=ModelType.TEXT_EMBEDDING, | |||
| fetch_from=FetchFrom.CUSTOMIZABLE_MODEL, | |||
| model_properties={ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size"))}, | |||
| model_properties={ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size", 8000))}, | |||
| ) | |||
| return entity | |||
| @@ -139,7 +139,7 @@ class OllamaEmbeddingModel(TextEmbeddingModel): | |||
| model_type=ModelType.TEXT_EMBEDDING, | |||
| fetch_from=FetchFrom.CUSTOMIZABLE_MODEL, | |||
| model_properties={ | |||
| ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size")), | |||
| ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size", 512)), | |||
| ModelPropertyKey.MAX_CHUNKS: 1, | |||
| }, | |||
| parameter_rules=[], | |||
| @@ -176,7 +176,7 @@ class OAICompatEmbeddingModel(_CommonOaiApiCompat, TextEmbeddingModel): | |||
| model_type=ModelType.TEXT_EMBEDDING, | |||
| fetch_from=FetchFrom.CUSTOMIZABLE_MODEL, | |||
| model_properties={ | |||
| ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size")), | |||
| ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size", 512)), | |||
| ModelPropertyKey.MAX_CHUNKS: 1, | |||
| }, | |||
| parameter_rules=[], | |||
| @@ -182,7 +182,7 @@ class OAICompatEmbeddingModel(_CommonOaiApiCompat, TextEmbeddingModel): | |||
| model_type=ModelType.TEXT_EMBEDDING, | |||
| fetch_from=FetchFrom.CUSTOMIZABLE_MODEL, | |||
| model_properties={ | |||
| ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size")), | |||
| ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size", 512)), | |||
| ModelPropertyKey.MAX_CHUNKS: 1, | |||
| }, | |||
| parameter_rules=[], | |||
| @@ -173,7 +173,7 @@ class VertexAiTextEmbeddingModel(_CommonVertexAi, TextEmbeddingModel): | |||
| model_type=ModelType.TEXT_EMBEDDING, | |||
| fetch_from=FetchFrom.CUSTOMIZABLE_MODEL, | |||
| model_properties={ | |||
| ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size")), | |||
| ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size", 512)), | |||
| ModelPropertyKey.MAX_CHUNKS: 1, | |||
| }, | |||
| parameter_rules=[], | |||
| @@ -166,7 +166,7 @@ class VoyageTextEmbeddingModel(TextEmbeddingModel): | |||
| label=I18nObject(en_US=model), | |||
| model_type=ModelType.TEXT_EMBEDDING, | |||
| fetch_from=FetchFrom.CUSTOMIZABLE_MODEL, | |||
| model_properties={ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size"))}, | |||
| model_properties={ModelPropertyKey.CONTEXT_SIZE: int(credentials.get("context_size", 512))}, | |||
| ) | |||
| return entity | |||