Skip to content

Commit

Permalink
Merge branch 'feat/document-segmentic' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Dec 28, 2023
2 parents ae9bce7 + 680d7b7 commit 582ca01
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions api/core/indexing_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,14 @@ def file_indexing_estimate(self, tenant_id: str, file_details: List[UploadFile],
"qa_preview": document_qa_list,
"preview": preview_texts
}
embedding_model_type_instance = cast(TextEmbeddingModel, embedding_model_instance.model_type_instance)
embedding_price_info = embedding_model_type_instance.get_price(
model=embedding_model_instance.model,
credentials=embedding_model_instance.credentials,
price_type=PriceType.INPUT,
tokens=tokens
)
if embedding_model_instance:
embedding_model_type_instance = cast(TextEmbeddingModel, embedding_model_instance.model_type_instance)
embedding_price_info = embedding_model_type_instance.get_price(
model=embedding_model_instance.model,
credentials=embedding_model_instance.credentials,
price_type=PriceType.INPUT,
tokens=tokens
)
return {
"total_segments": total_segments,
"tokens": tokens,
Expand Down

0 comments on commit 582ca01

Please sign in to comment.