Brianpuz commited on
Commit
6e929f3
·
verified ·
1 Parent(s): 60c42fc

Update app.py

Browse files

Delete the safetensors after converting it into fp16 to save space

Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -11,6 +11,8 @@ from gradio_huggingfacehub_search import HuggingfaceHubSearch
11
  from apscheduler.schedulers.background import BackgroundScheduler
12
  from datetime import datetime
13
  import numpy as np
 
 
14
 
15
  HF_TOKEN = os.environ.get("HF_TOKEN")
16
  os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
@@ -237,7 +239,7 @@ def process_model(model_id, q_method, use_imatrix, imatrix_q_method, private_rep
237
  result = subprocess.run(["python", CONVERSION_SCRIPT, local_dir, "--outtype", "f16", "--outfile", fp16], shell=False, capture_output=True)
238
  if result.returncode != 0:
239
  raise Exception(f"Error converting to fp16: {result.stderr.decode()}")
240
-
241
  imatrix_path = Path(outdir)/"imatrix.dat"
242
  if use_imatrix:
243
  train_data_path = train_data_file.name if train_data_file else "llama.cpp/groups_merged.txt"
 
11
  from apscheduler.schedulers.background import BackgroundScheduler
12
  from datetime import datetime
13
  import numpy as np
14
+ import shutil
15
+
16
 
17
  HF_TOKEN = os.environ.get("HF_TOKEN")
18
  os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
 
239
  result = subprocess.run(["python", CONVERSION_SCRIPT, local_dir, "--outtype", "f16", "--outfile", fp16], shell=False, capture_output=True)
240
  if result.returncode != 0:
241
  raise Exception(f"Error converting to fp16: {result.stderr.decode()}")
242
+ shutil.rmtree(downloads_dir)
243
  imatrix_path = Path(outdir)/"imatrix.dat"
244
  if use_imatrix:
245
  train_data_path = train_data_file.name if train_data_file else "llama.cpp/groups_merged.txt"