Terry Zhuo commited on
Commit
7d73426
1 Parent(s): d3f3b48

fix rm file logic

Browse files
Files changed (1) hide show
  1. src/execute.py +1 -2
src/execute.py CHANGED
@@ -48,13 +48,12 @@ def generate_command(
48
 
49
  def cleanup_previous_files(jsonl_file):
50
  if jsonl_file is not None:
51
- print("Finding files to delete")
52
  file_list = ['Dockerfile', 'app.py', 'README.md', os.path.basename(jsonl_file.name), "__pycache__"]
53
  else:
54
  file_list = ['Dockerfile', 'app.py', 'README.md', "__pycache__"]
55
  for file in glob.glob("*"):
56
  try:
57
- if file not in file_list or not file.startswith("bigcode"):
58
  os.remove(file)
59
  except Exception as e:
60
  print(f"Error during cleanup of {file}: {e}")
 
48
 
49
  def cleanup_previous_files(jsonl_file):
50
  if jsonl_file is not None:
 
51
  file_list = ['Dockerfile', 'app.py', 'README.md', os.path.basename(jsonl_file.name), "__pycache__"]
52
  else:
53
  file_list = ['Dockerfile', 'app.py', 'README.md', "__pycache__"]
54
  for file in glob.glob("*"):
55
  try:
56
+ if file not in file_list and not file.startswith("bigcode"):
57
  os.remove(file)
58
  except Exception as e:
59
  print(f"Error during cleanup of {file}: {e}")