binoua commited on
Commit
26de996
1 Parent(s): 625dfa6

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")
@@ -75,6 +75,7 @@ while not is_finished:
75
  evaluation_keys_remaining = evaluation_keys_remaining[packet_size:]
76
  else:
77
  evaluation_keys_piece = evaluation_keys_remaining
 
78
  is_finished = True
79
 
80
  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")
 
75
  evaluation_keys_remaining = evaluation_keys_remaining[packet_size:]
76
  else:
77
  evaluation_keys_piece = evaluation_keys_remaining
78
+ evaluation_keys_remaining = None
79
  is_finished = True
80
 
81
  print(