epalvarez commited on
Commit
e9c2e64
·
verified ·
1 Parent(s): df995a7

Using the scheduler

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -24,7 +24,7 @@ log_folder = log_file.parent
24
  hf_token = os.environ.get('HF_TOKEN')
25
  print(hf_token)
26
 
27
- Scheduler will log every 2 API calls:
28
  scheduler = CommitScheduler(
29
  repo_id="machine-failure-logs",
30
  repo_type="dataset",
@@ -59,7 +59,7 @@ def predict_machine_failure(air_temperature, process_temperature, rotational_spe
59
  data_point = pd.DataFrame([sample])
60
  prediction = machine_failure_predictor.predict(data_point).tolist()
61
 
62
- Each time we get a prediction we will determine if we should log it to a hugging_face dataset according to the schedule definition outside this function
63
  with scheduler.lock:
64
  with log_file.open("a") as f:
65
  f.write(json.dumps(
 
24
  hf_token = os.environ.get('HF_TOKEN')
25
  print(hf_token)
26
 
27
+ # Scheduler will log every 2 API calls:
28
  scheduler = CommitScheduler(
29
  repo_id="machine-failure-logs",
30
  repo_type="dataset",
 
59
  data_point = pd.DataFrame([sample])
60
  prediction = machine_failure_predictor.predict(data_point).tolist()
61
 
62
+ # Each time we get a prediction we will determine if we should log it to a hugging_face dataset according to the schedule definition outside this function
63
  with scheduler.lock:
64
  with log_file.open("a") as f:
65
  f.write(json.dumps(