Avoid closing an unopened file.
@@ -117,6 +117,7 @@ def run(input_file: KGTKFiles, english_only, output_file: KGTKFiles, weights_fil
# Clean up
ew.close()
+ if weights_file:
ew_aux.close()
except Exception as e:
