Skip to content

Commit c920377

Browse files
committed
Remove entry points
1 parent a3d84c0 commit c920377

File tree

2 files changed

+0
-70
lines changed

2 files changed

+0
-70
lines changed

image_processing/src/image_processing/figure_analysis.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4-
import json
54
import logging
65
import os
7-
import azure.functions as func
86
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
9-
import asyncio
107
from openai import (
118
AsyncAzureOpenAI,
129
OpenAIError,
@@ -152,31 +149,3 @@ async def analyse(self, record: dict) -> dict:
152149
"errors": None,
153150
"warnings": None,
154151
}
155-
156-
157-
async def main(req: func.HttpRequest) -> func.HttpResponse:
158-
try:
159-
req_body = req.get_json()
160-
values = req_body.get("values")
161-
except ValueError:
162-
return func.HttpResponse(
163-
"Please valid Custom Skill Payload in the request body", status_code=400
164-
)
165-
else:
166-
logging.info("Input Values: %s", values)
167-
168-
record_tasks = []
169-
170-
figure_analysis = FigureAnalysis()
171-
172-
for value in values:
173-
record_tasks.append(asyncio.create_task(figure_analysis.analyse(value)))
174-
175-
results = await asyncio.gather(*record_tasks)
176-
logging.info("Results: %s", results)
177-
178-
return func.HttpResponse(
179-
json.dumps({"values": results}),
180-
status_code=200,
181-
mimetype="application/json",
182-
)

image_processing/src/image_processing/layout_analysis.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
# Licensed under the MIT License.
33
# This code originates from: https://github.com/microsoft/dstoolkit-text2sql-and-imageprocessing
44

5-
import json
65
import logging
76
import os
87
import urllib
9-
import azure.functions as func
108
import tempfile
119
from azure.storage.blob.aio import BlobServiceClient
1210
from azure.identity import DefaultAzureCredential
@@ -546,40 +544,3 @@ async def process_layout_analysis(
546544
],
547545
"warnings": None,
548546
}
549-
550-
551-
async def main(req: func.HttpRequest) -> func.HttpResponse:
552-
try:
553-
req_body = req.get_json()
554-
values = req_body.get("values")
555-
adi_config = req.headers
556-
557-
page_wise = adi_config.get("page_wise", "False").lower() == "true"
558-
extract_figures = adi_config.get("extract_figures", "True").lower() == "true"
559-
logging.info(f"Chunk by Page: {page_wise}")
560-
except ValueError:
561-
return func.HttpResponse(
562-
"Please valid Custom Skill Payload in the request body", status_code=400
563-
)
564-
else:
565-
logging.info("Input Values: %s", values)
566-
567-
record_tasks = []
568-
569-
for value in values:
570-
record_tasks.append(
571-
asyncio.create_task(
572-
process_layout_analysis(
573-
value, page_wise=page_wise, extract_figures=extract_figures
574-
)
575-
)
576-
)
577-
578-
results = await asyncio.gather(*record_tasks)
579-
logging.info("Results: %s", results)
580-
581-
return func.HttpResponse(
582-
json.dumps({"values": results}),
583-
status_code=200,
584-
mimetype="application/json",
585-
)

0 commit comments

Comments
 (0)