cspocketindia commited on
Commit
4e52c2b
1 Parent(s): 70c0af2

Remove git_pull from execution loop

Browse files
Files changed (1) hide show
  1. gradio_app.py +5 -10
gradio_app.py CHANGED
@@ -25,27 +25,22 @@ repo = huggingface_hub.Repository(
25
  clone_from="https://huggingface.co/datasets/jeevavijay10/senti-pred-gradio",
26
  token=hf_token,
27
  )
 
28
 
29
  def log_record(vals):
30
 
31
- repo.git_pull(lfs=False)
32
-
33
- log_file = Path(dataset_dir) / "data.csv"
34
-
35
- is_new = not Path(log_file).exists()
36
-
37
  with open(log_file, "a", newline="", encoding="utf-8") as csvfile:
38
  writer = csv.writer(csvfile)
39
-
40
  if is_new:
41
  writer.writerow(utils.sanitize_list_for_csv(headers))
42
-
43
  writer.writerow(utils.sanitize_list_for_csv(vals))
44
 
45
  with open(log_file, "r", encoding="utf-8") as csvfile:
46
  line_count = len([None for _ in csv.reader(csvfile)]) - 1
47
-
48
- repo.push_to_hub(commit_message=f"Logged sample #{line_count}",blocking=False)
49
 
50
 
51
  def predict(sentence):
 
25
  clone_from="https://huggingface.co/datasets/jeevavijay10/senti-pred-gradio",
26
  token=hf_token,
27
  )
28
+ repo.git_pull(lfs=False)
29
 
30
  def log_record(vals):
31
 
32
+ log_file = Path(dataset_dir) / "data.csv"
33
+ is_new = not Path(log_file).exists()
 
 
 
 
34
  with open(log_file, "a", newline="", encoding="utf-8") as csvfile:
35
  writer = csv.writer(csvfile)
 
36
  if is_new:
37
  writer.writerow(utils.sanitize_list_for_csv(headers))
 
38
  writer.writerow(utils.sanitize_list_for_csv(vals))
39
 
40
  with open(log_file, "r", encoding="utf-8") as csvfile:
41
  line_count = len([None for _ in csv.reader(csvfile)]) - 1
42
+
43
+ repo.push_to_hub(commit_message=f"Logged sample #{line_count}")
44
 
45
 
46
  def predict(sentence):