Skip to content

Commit

Permalink
Refactored Summarization
Browse files Browse the repository at this point in the history
  • Loading branch information
akshata29 committed Jul 29, 2023
1 parent a1fc9bb commit 2bf93c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion api/Python/DocGenerator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def summarizeGenerateQa(docs, embeddingModelType, deploymentType):

try:
summaryChain = load_summarize_chain(llm, chain_type="map_reduce")
summary = summaryChain.run(docs)
summary = summaryChain.run(docs[:5])
logging.info("Document Summary completed")
except Exception as e:
logging.error("Exception during summary" + str(e))
Expand Down Expand Up @@ -340,6 +340,7 @@ def Embed(indexType, loadType, multiple, indexName, value, blobConnectionStrin
"chunkSize": chunkSize, "chunkOverlap": chunkOverlap,
"promptType": promptType,
"singleFile": singleFile}
logging.info(str(metadata))
upsertMetadata(OpenAiDocConnStr, OpenAiDocContainer, fileName, metadata)
try:
metadata = {'summary': summary.replace("-", "_"), 'qa': qa.replace("-", "_")}
Expand Down
2 changes: 1 addition & 1 deletion api/Python/IndexManagement/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def IndexManagement(indexType, indexName, blobName, indexNs, operation, record):
index.delete(delete_all=True, namespace=indexNs)
elif indexType == "redis":
Redis.drop_index(index_name=indexNs, delete_documents=True, redis_url=redisUrl)
elif indexType == "cogsearch":
elif indexType == "cogsearch" or indexType == "cogsearchvs":
deleteSearchIndex(indexNs)
blobList = getAllBlobs(OpenAiDocConnStr, OpenAiDocContainer)
for blob in blobList:
Expand Down

0 comments on commit 2bf93c0

Please sign in to comment.