mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
fix error weaviate vector (#1058)
Co-authored-by: jyong <jyong@dify.ai>
This commit is contained in:
parent
e34dcc0406
commit
7df56ed617
|
@ -329,16 +329,23 @@ def create_qdrant_indexes():
|
||||||
model_name=dataset.embedding_model
|
model_name=dataset.embedding_model
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
provider = Provider(
|
try:
|
||||||
id='provider_id',
|
embedding_model = ModelFactory.get_embedding_model(
|
||||||
tenant_id=dataset.tenant_id,
|
tenant_id=dataset.tenant_id
|
||||||
provider_name='openai',
|
)
|
||||||
provider_type=ProviderType.CUSTOM.value,
|
dataset.embedding_model = embedding_model.name
|
||||||
encrypted_config=json.dumps({'openai_api_key': 'TEST'}),
|
dataset.embedding_model_provider = embedding_model.model_provider.provider_name
|
||||||
is_valid=True,
|
except Exception:
|
||||||
)
|
provider = Provider(
|
||||||
model_provider = OpenAIProvider(provider=provider)
|
id='provider_id',
|
||||||
embedding_model = OpenAIEmbedding(name="text-embedding-ada-002", model_provider=model_provider)
|
tenant_id=dataset.tenant_id,
|
||||||
|
provider_name='openai',
|
||||||
|
provider_type=ProviderType.SYSTEM.value,
|
||||||
|
encrypted_config=json.dumps({'openai_api_key': 'TEST'}),
|
||||||
|
is_valid=True,
|
||||||
|
)
|
||||||
|
model_provider = OpenAIProvider(provider=provider)
|
||||||
|
embedding_model = OpenAIEmbedding(name="text-embedding-ada-002", model_provider=model_provider)
|
||||||
embeddings = CacheEmbedding(embedding_model)
|
embeddings = CacheEmbedding(embedding_model)
|
||||||
|
|
||||||
from core.index.vector_index.qdrant_vector_index import QdrantVectorIndex, QdrantConfig
|
from core.index.vector_index.qdrant_vector_index import QdrantVectorIndex, QdrantConfig
|
||||||
|
|
Loading…
Reference in New Issue
Block a user