da03 commited on
Commit
6f44b29
·
1 Parent(s): 8ce373e
Files changed (1) hide show
  1. main.py +4 -3
main.py CHANGED
@@ -24,6 +24,7 @@ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
24
 
25
  DEBUG_MODE = False
26
  DEBUG_MODE_2 = True
 
27
 
28
  SCREEN_WIDTH = 512
29
  SCREEN_HEIGHT = 384
@@ -103,7 +104,7 @@ def prepare_model_inputs(
103
  print ('DEBUG MODE, SETTING TIME STEP TO 0')
104
  time_step = 0
105
  if DEBUG_MODE_2:
106
- if time_step > 1:
107
  print ('DEBUG MODE_2, SETTING TIME STEP TO 0')
108
  time_step = 0
109
 
@@ -127,7 +128,7 @@ def prepare_model_inputs(
127
  if 'hidden_states' in inputs:
128
  del inputs['hidden_states']
129
  if DEBUG_MODE_2:
130
- if time_step > 1:
131
  print ('DEBUG MODE_2, REMOVING HIDDEN STATES')
132
  if 'hidden_states' in inputs:
133
  del inputs['hidden_states']
@@ -259,7 +260,7 @@ async def websocket_endpoint(websocket: WebSocket):
259
  print (f"DEBUG MODE, REMOVING HIDDEN STATES")
260
  previous_frame = padding_image
261
  if DEBUG_MODE_2:
262
- if frame_num > 1:
263
  print (f"DEBUG MODE_2, REMOVING HIDDEN STATES")
264
  previous_frame = padding_image
265
  inputs = prepare_model_inputs(previous_frame, hidden_states, x, y, is_right_click, is_left_click, list(keys_down), stoi, itos, frame_num)
 
24
 
25
  DEBUG_MODE = False
26
  DEBUG_MODE_2 = True
27
+ NUM_MAX_FRAMES = 2
28
 
29
  SCREEN_WIDTH = 512
30
  SCREEN_HEIGHT = 384
 
104
  print ('DEBUG MODE, SETTING TIME STEP TO 0')
105
  time_step = 0
106
  if DEBUG_MODE_2:
107
+ if time_step > NUM_MAX_FRAMES-1:
108
  print ('DEBUG MODE_2, SETTING TIME STEP TO 0')
109
  time_step = 0
110
 
 
128
  if 'hidden_states' in inputs:
129
  del inputs['hidden_states']
130
  if DEBUG_MODE_2:
131
+ if time_step > NUM_MAX_FRAMES-1:
132
  print ('DEBUG MODE_2, REMOVING HIDDEN STATES')
133
  if 'hidden_states' in inputs:
134
  del inputs['hidden_states']
 
260
  print (f"DEBUG MODE, REMOVING HIDDEN STATES")
261
  previous_frame = padding_image
262
  if DEBUG_MODE_2:
263
+ if frame_num > NUM_MAX_FRAMES-1:
264
  print (f"DEBUG MODE_2, REMOVING HIDDEN STATES")
265
  previous_frame = padding_image
266
  inputs = prepare_model_inputs(previous_frame, hidden_states, x, y, is_right_click, is_left_click, list(keys_down), stoi, itos, frame_num)