delete temp file

This commit is contained in:
leafspark 2024-08-02 21:28:40 -07:00 committed by GitHub
parent 1c36d737cf
commit 108e30f1f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 35 deletions

View File

@ -1,35 +0,0 @@
import re
def modify_file(filename):
with open(filename, 'r') as file:
content = file.read()
# Replace validate_quantization_inputs method
content = re.sub(
r'def validate_quantization_inputs\(self\):.*?if not self\.backend_input\.text\(\):.*?raise ValueError\("Backend path is required"\)',
'def validate_quantization_inputs(self):\n if not self.backend_combo.currentData():\n raise ValueError("No backend selected")',
content, flags=re.DOTALL
)
# Replace in generate_imatrix method
content = re.sub(
r'backend_path = self\.backend_input\.text\(\)',
'backend_path = self.backend_combo.currentData()',
content
)
# Remove browse_backend method
content = re.sub(
r'def browse_backend\(self\):.*?ensure_directory\(backend_path\)\n',
'',
content, flags=re.DOTALL
)
# Write the modified content back to the file
with open(filename, 'w') as file:
file.write(content)
print(f"File {filename} has been modified.")
# Use the function
modify_file('AutoGGUF.py')