Skip to content

Commit

Permalink
fix freeze if temporary file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Nov 21, 2024
1 parent 37933ff commit 1fb4a62
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions EasyQuantizationGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ def run_llama_quantize():
output_dir = os.path.dirname(output_file)
temp_gguf_file = os.path.join(output_dir, "temporary_file_during_quantization")

# Add cleanup of existing temp file
if os.path.exists(temp_gguf_file):
try:
os.remove(temp_gguf_file)
process_text.insert(tk.END, "Cleaned up existing temporary file.\n")
process_text.see(tk.END)
root.update()
except Exception as e:
process_text.insert(tk.END, f"Error cleaning up temporary file: {e}\n")
process_text.see(tk.END)
root.update()
enable_ui()
return

try:
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
Expand Down

0 comments on commit 1fb4a62

Please sign in to comment.