Spaces:
Runtime error
Runtime error
Update gen_client.py
Browse filesupdate get_ranking_location
- gen_client.py +7 -2
gen_client.py
CHANGED
@@ -642,14 +642,19 @@ class HumanGenService:
|
|
642 |
startt = self.all_requests_time[req]
|
643 |
waste_time = (endt - startt)/60
|
644 |
if waste_time > avg_process_time + 1:
|
|
|
|
|
|
|
|
|
|
|
645 |
data = '{"header":{"request_id":"","service_id":"","task_id":""},"payload":{"input": {"ref_image_path": "", "ref_video_path": "", "ref_video_name": "", "input_prompt": "", "prompt_template": "", "scale_depth": 0.7, "scale_pose": 0.5},"parameters":{}}}'
|
646 |
data = json.loads(data) # string to dict
|
647 |
data['header']['service_id'] = DASHONE_SERVICE_ID
|
648 |
data['header']['request_id'] = req
|
649 |
data['header']['task_id'] = req
|
650 |
data['header']['attributes'] = {}
|
651 |
-
data['header']['attributes']['user_id'] =
|
652 |
-
data['payload']['input']['user_id'] =
|
653 |
data = json.dumps(data) # to string
|
654 |
ret_status, ret_json = query_video_generation(request_id=req, data=data)
|
655 |
# print(f'ret_json = {ret_json}')
|
|
|
642 |
startt = self.all_requests_time[req]
|
643 |
waste_time = (endt - startt)/60
|
644 |
if waste_time > avg_process_time + 1:
|
645 |
+
uuid = ''
|
646 |
+
for uid in self.all_user_requests:
|
647 |
+
if req in self.all_user_requests[uid]:
|
648 |
+
uuid = uid
|
649 |
+
break
|
650 |
data = '{"header":{"request_id":"","service_id":"","task_id":""},"payload":{"input": {"ref_image_path": "", "ref_video_path": "", "ref_video_name": "", "input_prompt": "", "prompt_template": "", "scale_depth": 0.7, "scale_pose": 0.5},"parameters":{}}}'
|
651 |
data = json.loads(data) # string to dict
|
652 |
data['header']['service_id'] = DASHONE_SERVICE_ID
|
653 |
data['header']['request_id'] = req
|
654 |
data['header']['task_id'] = req
|
655 |
data['header']['attributes'] = {}
|
656 |
+
data['header']['attributes']['user_id'] = uuid
|
657 |
+
data['payload']['input']['user_id'] = uuid
|
658 |
data = json.dumps(data) # to string
|
659 |
ret_status, ret_json = query_video_generation(request_id=req, data=data)
|
660 |
# print(f'ret_json = {ret_json}')
|