Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/GenAIExample_SearchQnA_d…
Browse files Browse the repository at this point in the history
…eploy_on_AMD' into feature/GenAIExample_SearchQnA_deploy_on_AMD
  • Loading branch information
Chingis Yundunov authored and Chingis Yundunov committed Jan 16, 2025
2 parents 1fe85fa + 3d7efa0 commit 20299b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions DocSum/docsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def read_pdf(file):


def video2audio(
video_base64: str,
video_base64: str,
) -> str:
"""Convert a base64 video string to a base64 audio string using ffmpeg.
Expand Down Expand Up @@ -114,8 +114,8 @@ def read_text_from_file(file, save_file_name):
file_content = [doc.page_content for doc in documents]
# read docx file
elif (
file.headers["content-type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
or file.headers["content-type"] == "application/octet-stream"
file.headers["content-type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
or file.headers["content-type"] == "application/octet-stream"
):
file_content = docx2txt.process(save_file_name)

Expand Down Expand Up @@ -247,9 +247,9 @@ async def handle_request(self, request: Request, files: List[UploadFile] = File(
for node, response in result_dict.items():
# Here it suppose the last microservice in the megaservice is LLM.
if (
isinstance(response, StreamingResponse)
and node == list(self.megaservice.services.keys())[-1]
and self.megaservice.services[node].service_type == ServiceType.LLM
isinstance(response, StreamingResponse)
and node == list(self.megaservice.services.keys())[-1]
and self.megaservice.services[node].service_type == ServiceType.LLM
):
return response
else:
Expand All @@ -260,9 +260,9 @@ async def handle_request(self, request: Request, files: List[UploadFile] = File(
for node, response in result_dict.items():
# Here it suppose the last microservice in the megaservice is LLM.
if (
isinstance(response, StreamingResponse)
and node == list(self.megaservice.services.keys())[-1]
and self.megaservice.services[node].service_type == ServiceType.LLM
isinstance(response, StreamingResponse)
and node == list(self.megaservice.services.keys())[-1]
and self.megaservice.services[node].service_type == ServiceType.LLM
):
return response

Expand Down Expand Up @@ -297,4 +297,4 @@ def start(self):
if __name__ == "__main__":
docsum = DocSumService(port=MEGA_SERVICE_PORT)
docsum.add_remote_service()
docsum.start()
docsum.start()
2 changes: 1 addition & 1 deletion DocSum/tests/test_compose_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,4 @@ function main() {
echo "==========================================="
}

main
main

0 comments on commit 20299b2

Please sign in to comment.