binoua commited on
Commit
d161508
1 Parent(s): 762796b

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")
@@ -82,6 +82,7 @@ while not is_finished:
82
  evaluation_keys_remaining = evaluation_keys_remaining[packet_size:]
83
  else:
84
  evaluation_keys_piece = evaluation_keys_remaining
 
85
  is_finished = True
86
 
87
  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")
 
82
  evaluation_keys_remaining = evaluation_keys_remaining[packet_size:]
83
  else:
84
  evaluation_keys_piece = evaluation_keys_remaining
85
+ evaluation_keys_remaining = None
86
  is_finished = True
87
 
88
  print(