Skip to content

Commit

Permalink
style: ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
adharm committed Feb 28, 2024
1 parent faa9eb0 commit 7d3ff09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ragatouille/RAGTrainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ def prepare_training_data(
)
if len(self.data_processor.training_triplets) == 0:
if mine_hard_negatives:
print("Warning: No training triplets were generated with setting mine_hard_negatives=='True'. This may be due to the data being too small or the hard negative miner not being able to find enough hard negatives.")
print(
"Warning: No training triplets were generated with setting mine_hard_negatives=='True'. This may be due to the data being too small or the hard negative miner not being able to find enough hard negatives."
)
self.data_processor.process_raw_data(
data_type=data_type,
raw_data=raw_data,
Expand Down
4 changes: 3 additions & 1 deletion ragatouille/data/training_data_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ def _get_new_negatives(self, query, passages, mine_hard_negatives, n_new_negativ
else:
new_negatives = [
x
for x in random.sample(self.collection, min(n_new_negatives, len(self.collection)))
for x in random.sample(
self.collection, min(n_new_negatives, len(self.collection))
)
if x not in passages["positives"] and x not in passages["negatives"]
]

Expand Down

0 comments on commit 7d3ff09

Please sign in to comment.