[Serve] Migrate from Flask.Request to Starlette Request (#12852)

This commit is contained in:
architkulkarni
2020-12-21 13:34:15 -08:00
committed by GitHub
parent 5b48480e29
commit 8b4b4bf0a2
26 changed files with 140 additions and 174 deletions
@@ -54,9 +54,9 @@ class BoostingModel:
with open(LABEL_PATH) as f:
self.label_list = json.load(f)
def __call__(self, flask_request):
payload = flask_request.json
print("Worker: received flask request with data", payload)
async def __call__(self, starlette_request):
payload = await starlette_request.json()
print("Worker: received starlette request with data", payload)
input_vector = [
payload["sepal length"],