Skip to content

Commit

Permalink
added an option to the config so that the models can be silent-triale…
Browse files Browse the repository at this point in the history
…d and log all predictions. Logic ensures no files are generated in production. Back-compatible with existing configs (#195)
  • Loading branch information
bnestor authored Sep 20, 2024
1 parent e66c651 commit 5b36f44
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions InferenceSystem/src/LiveInferenceOrchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,17 @@ def populate_metadata_json(
os.remove(clip_path)
os.remove(spectrogram_path)

if 'log_results' in config_params:
if config_params['upload_to_azure']:
# override the logging, since it is already deployed
pass
elif config_params['log_results'] is not None:
# log silent trial data to destination folder
os.makedirs(config_params['log_results'], exist_ok=True)
prediction_results.update({'model_type': config_params['model_type'],'model_name': config_params['model_name'], 'model_path':config_params['model_path']})
json_name = os.path.basename(clip_path).replace('.wav', '.json')
with open(os.path.join(config_params['log_results'], json_name), 'w+') as f:
json.dump(prediction_results, f)

# get next current_clip_end_time by adding 60 seconds to current_clip_end_time
current_clip_end_time = current_clip_end_time + timedelta(0, hls_polling_interval)

0 comments on commit 5b36f44

Please sign in to comment.