|
yield (key, predictions) # TODO fix mixing yield and return in DoFn |
wait += 1
time.sleep(wait*wait)
response = requests.post(self.inference_url, json=data)
response.raise_for_status()
predictions = response.json().get("predictions", [])
logging.info(f"Inference response:\n key: {key} predictions:{len(predictions)}")
yield (key, predictions) # TODO fix mixing yield and return in DoFn
class ListCombine(beam.CombineFn):
whale-speech/src/stages/classify.py
Line 311 in 725794e