pycache 추가

This commit is contained in:
kyy
2025-10-30 10:31:18 +09:00
parent 2bb5879169
commit bea690d3f1
88 changed files with 0 additions and 2104 deletions

View File

@@ -1,30 +0,0 @@
import os
import json
dir_path = "result/gemma3-upstage/"
files_to_delete = []
for filename in os.listdir(dir_path):
if filename.endswith(".json"):
file_path = os.path.join(dir_path, filename)
try:
with open(file_path, 'r', encoding='utf-8') as f:
data = json.load(f)
if "result" in data:
result_data = data["result"]
# Check if result is an empty dictionary or contains "Error" key
if not result_data or "Error" in result_data:
files_to_delete.append(file_path)
except (json.JSONDecodeError, KeyError) as e:
print(f"Error processing file {filename}: {e}")
for file_path in files_to_delete:
try:
os.remove(file_path)
print(f"Deleted: {os.path.basename(file_path)}")
except OSError as e:
print(f"Error deleting file {os.path.basename(file_path)}: {e}")
print(f"\nTotal deleted files: {len(files_to_delete)}")