binoua commited on
Commit
ecf5cf4
1 Parent(s): 3d2d528

chore: fixing an issue for circuits with keys.

Browse files
Files changed (1) hide show
  1. play_with_endpoint.py +2 -1
play_with_endpoint.py CHANGED
@@ -30,7 +30,7 @@ headers = {
30
  def query(payload, allowed_retries=2):
31
  response = requests.post(API_URL, headers=headers, json=payload)
32
 
33
- if "error" in response.json():
34
  if allowed_retries > 0:
35
  # Sometimes we have "Bad gateway" error
36
  print(f"Warning, error {response=} {response.json()=} in the query, relaunching")
@@ -74,6 +74,7 @@ while not is_finished:
74
  evaluation_keys_remaining = evaluation_keys_remaining[packet_size:]
75
  else:
76
  evaluation_keys_piece = evaluation_keys_remaining
 
77
  is_finished = True
78
 
79
  print(
 
30
  def query(payload, allowed_retries=2):
31
  response = requests.post(API_URL, headers=headers, json=payload)
32
 
33
+ if response.json() is not None and "error" in response.json():
34
  if allowed_retries > 0:
35
  # Sometimes we have "Bad gateway" error
36
  print(f"Warning, error {response=} {response.json()=} in the query, relaunching")
 
74
  evaluation_keys_remaining = evaluation_keys_remaining[packet_size:]
75
  else:
76
  evaluation_keys_piece = evaluation_keys_remaining
77
+ evaluation_keys_remaining = None
78
  is_finished = True
79
 
80
  print(