janmariakowalski commited on
Commit
fa935cc
·
verified ·
1 Parent(s): 4188d46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -67,7 +67,7 @@ def log_prediction(log_data: dict):
67
  timestamp = log_data.get('timestamp', datetime.now().timestamp())
68
 
69
  try:
70
- logger.info("Logging to Hugging Face Hub upload_file: ", dict)
71
 
72
  api.upload_file(
73
  path_or_fileobj=json.dumps(log_data, indent=2, ensure_ascii=False).encode('utf-8'),
@@ -76,8 +76,10 @@ def log_prediction(log_data: dict):
76
  repo_type="dataset",
77
  commit_message="log prediction",
78
  token=HF_TOKEN,
79
- run_as_future=True
80
  )
 
 
81
  except Exception as e:
82
  logger.error(f"Failed to log prediction to hub: {e}")
83
 
 
67
  timestamp = log_data.get('timestamp', datetime.now().timestamp())
68
 
69
  try:
70
+ logger.info("Logging to Hugging Face Hub upload_file: ", log_data)
71
 
72
  api.upload_file(
73
  path_or_fileobj=json.dumps(log_data, indent=2, ensure_ascii=False).encode('utf-8'),
 
76
  repo_type="dataset",
77
  commit_message="log prediction",
78
  token=HF_TOKEN,
79
+ run_as_future=False
80
  )
81
+ logger.info("Logging to Hugging Face Hub upload_file finished")
82
+
83
  except Exception as e:
84
  logger.error(f"Failed to log prediction to hub: {e}")
85