da03 commited on
Commit
a5bfa12
·
1 Parent(s): 878b202
Files changed (1) hide show
  1. main.py +4 -3
main.py CHANGED
@@ -183,16 +183,17 @@ async def websocket_endpoint(websocket: WebSocket):
183
  for key in keys_up_list:
184
  if key in keys_down: # Check if key exists to avoid KeyError
185
  keys_down.remove(key)
186
-
187
  inputs = prepare_model_inputs(previous_frame, hidden_states, x, y, is_right_click, is_left_click, list(keys_down), stoi, itos, frame_num)
188
-
189
  previous_frame, sample_img, hidden_states, timing_info = process_frame(model, inputs)
190
  timing_info['full_frame'] = time.perf_counter() - start_frame
191
-
192
  img = Image.fromarray(sample_img)
193
  buffered = io.BytesIO()
194
  img.save(buffered, format="PNG")
195
  img_str = base64.b64encode(buffered.getvalue()).decode()
 
196
 
197
  # Send the generated frame back to the client
198
  await websocket.send_json({"image": img_str})
 
183
  for key in keys_up_list:
184
  if key in keys_down: # Check if key exists to avoid KeyError
185
  keys_down.remove(key)
186
+ print ('here1')
187
  inputs = prepare_model_inputs(previous_frame, hidden_states, x, y, is_right_click, is_left_click, list(keys_down), stoi, itos, frame_num)
188
+ print ('here2')
189
  previous_frame, sample_img, hidden_states, timing_info = process_frame(model, inputs)
190
  timing_info['full_frame'] = time.perf_counter() - start_frame
191
+ print ('here3')
192
  img = Image.fromarray(sample_img)
193
  buffered = io.BytesIO()
194
  img.save(buffered, format="PNG")
195
  img_str = base64.b64encode(buffered.getvalue()).decode()
196
+ print ('here4')
197
 
198
  # Send the generated frame back to the client
199
  await websocket.send_json({"image": img_str})