Skip to content

Commit

Permalink
move to experiments folder
Browse files Browse the repository at this point in the history
  • Loading branch information
whoisjones committed Aug 2, 2023
1 parent fe5f077 commit 9bea88b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def hf_to_squad(dataset_name: str) -> str:
# Model Training
reader_directory = f"{squad_filename}-{num_samples}-{model_name}"
reader = FARMReader(model_name_or_path=model_name, return_no_answer=True, use_confidence_scores=False)
reader.train(data_dir=".", train_filename=train_filename, dev_split=0.1, use_gpu=True, batch_size=16, max_seq_len=384)
reader.train(data_dir="..", train_filename=train_filename, dev_split=0.1, use_gpu=True, batch_size=16, max_seq_len=384)
reader.save(Path(reader_directory))

# Model Evaluation
reader = FARMReader(reader_directory, return_no_answer=True, use_confidence_scores=False, max_seq_len=384)
reader_eval_results = reader.eval_on_file(data_dir=".", test_filename="dev-v2.0.json")
reader_eval_results = reader.eval_on_file(data_dir="..", test_filename="dev-v2.0.json")
with open("log.txt", "a") as log_file:
log_file.write(str(reader_directory)+'\n')
log_file.write(str(reader_eval_results)+'\n')
Expand Down

0 comments on commit 9bea88b

Please sign in to comment.