masamori commited on
Commit
f7d8544
1 Parent(s): 9e2d49f

Update ReadME

Browse files
Files changed (1) hide show
  1. README.md +21 -0
README.md CHANGED
@@ -84,4 +84,25 @@ def generate_predictions(model, tokenizer, input_file, output_file):
84
  for result in results:
85
  json.dump(result, f, ensure_ascii=False)
86
  f.write('\n')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  ```
 
84
  for result in results:
85
  json.dump(result, f, ensure_ascii=False)
86
  f.write('\n')
87
+
88
+ def main():
89
+ # GPUメモリのクリア
90
+ torch.cuda.empty_cache()
91
+
92
+ # 時間計測の追加
93
+ import time
94
+ start_time = time.time()
95
+
96
+ model, tokenizer = load_model()
97
+ input_file = "{$file_path}"
98
+ output_file = os.path.join(BASE_DIR, "{$file_path}")
99
+
100
+ generate_predictions(model, tokenizer, input_file, output_file)
101
+
102
+ # 実行時間の表示
103
+ elapsed_time = time.time() - start_time
104
+ print(f"総実行時間: {elapsed_time / 60:.2f}分")
105
+
106
+ if __name__ == "__main__":
107
+ main()
108
  ```