testbot commited on
Commit
02d2aee
β€’
1 Parent(s): 8c68c2f

explicitly delete local converted files

Browse files
Files changed (2) hide show
  1. app.py +1 -0
  2. convert.py +3 -0
app.py CHANGED
@@ -129,6 +129,7 @@ def run(
129
  yield _log(
130
  f"### Success πŸ”₯\n\nYay! This model was successfully converted! Make sure to let the repo owner know about it and review your PR. You might need to complete the PR manually, especially to add information in the model card."
131
  )
 
132
  _delete_cache()
133
  return
134
  except Exception as e:
 
129
  yield _log(
130
  f"### Success πŸ”₯\n\nYay! This model was successfully converted! Make sure to let the repo owner know about it and review your PR. You might need to complete the PR manually, especially to add information in the model card."
131
  )
132
+ model_path.unlink(missing_ok=True)
133
  _delete_cache()
134
  return
135
  except Exception as e:
convert.py CHANGED
@@ -41,6 +41,9 @@ def convert(
41
  yield f"Running command: `{' '.join(cmd)}`"
42
  run(cmd, check=True)
43
  assert q_model_path.is_file()
 
 
 
44
  model_path = q_model_path
45
  yield f"Model successfully quantized: {model_path}"
46
 
 
41
  yield f"Running command: `{' '.join(cmd)}`"
42
  run(cmd, check=True)
43
  assert q_model_path.is_file()
44
+
45
+ # Delete non-quantized file
46
+ model_path.unlink(missing_ok=True)
47
  model_path = q_model_path
48
  yield f"Model successfully quantized: {model_path}"
49