accept compressed responses for smaller wire payload
This commit is contained in:
@@ -336,11 +336,12 @@ class OnlineTeacherCollator(KDBatchSamplerDataCollatorForSeq2Seq):
|
|||||||
ret_data_target_mask: List[List[List[int]]] = []
|
ret_data_target_mask: List[List[List[int]]] = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
headers = {"Accept-Encoding": "deflate, gzip, br, zstd"}
|
||||||
response = self.http_session.post(
|
response = self.http_session.post(
|
||||||
api_endpoint,
|
api_endpoint,
|
||||||
json=payload,
|
json=payload,
|
||||||
|
headers=headers,
|
||||||
timeout=self.kd_online_timeout,
|
timeout=self.kd_online_timeout,
|
||||||
# json_decoder=orjson.loads,
|
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
api_data: dict = orjson.loads(response.content)
|
api_data: dict = orjson.loads(response.content)
|
||||||
|
|||||||
Reference in New Issue
Block a user