Merge pull request #2 from tsukimiya/add-gitignore

Remove history.tsv from the repository
Fixed a problem in which writing the header line failed if history.tsv did not exist.
pull/10/head
bbc_mc 2022-12-22 00:24:36 +09:00 committed by GitHub
commit 44b0b28b2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/csv/history.tsv

View File

@ -1 +0,0 @@
model_A model_A_hash model_B model_B_hash model_O model_O_hash base_alpha weight_name weight_values
1 model_A model_A_hash model_B model_B_hash model_O model_O_hash base_alpha weight_name weight_values

View File

@ -32,8 +32,8 @@ class MergeHistory():
if not os.path.exists(self.filepath):
with open(self.filepath, "w", newline="", encoding="utf-8") as f:
wr = writer(f, fieldnames=HEADERS, delimiter='\t')
wr.writerow(HEADERS)
wr = DictWriter(f, fieldnames=HEADERS, delimiter='\t')
wr.writeheader()
# save to file
with open(self.filepath, "a", newline="", encoding='utf-8') as f:
dictwriter = DictWriter(f, fieldnames=HEADERS, delimiter='\t')