Skip to content

Commit

Permalink
Merge pull request #1231 from hanhainebula/master
Browse files Browse the repository at this point in the history
fix bugs and refactor code
  • Loading branch information
545999961 authored Nov 15, 2024
2 parents 410d049 + 6c448d7 commit 9abcfc8
Show file tree
Hide file tree
Showing 18 changed files with 294 additions and 214 deletions.
40 changes: 22 additions & 18 deletions FlagEmbedding/evaluation/air_bench/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,27 @@
)


parser = HfArgumentParser((
AIRBenchEvalArgs,
AIRBenchEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: AIRBenchEvalArgs
model_args: AIRBenchEvalModelArgs

runner = AIRBenchEvalRunner(
eval_args=eval_args,
model_args=model_args
)
def main():
parser = HfArgumentParser((
AIRBenchEvalArgs,
AIRBenchEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: AIRBenchEvalArgs
model_args: AIRBenchEvalModelArgs

runner = AIRBenchEvalRunner(
eval_args=eval_args,
model_args=model_args
)

runner.run()

runner.run()

print("==============================================")
print("Search results have been generated.")
print("For computing metrics, please refer to the official AIR-Bench docs:")
print("- https://github.com/AIR-Bench/AIR-Bench/blob/main/docs/submit_to_leaderboard.md")
if __name__ == "__main__":
main()
print("==============================================")
print("Search results have been generated.")
print("For computing metrics, please refer to the official AIR-Bench docs:")
print("- https://github.com/AIR-Bench/AIR-Bench/blob/main/docs/submit_to_leaderboard.md")
33 changes: 19 additions & 14 deletions FlagEmbedding/evaluation/beir/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
)


parser = HfArgumentParser((
BEIREvalArgs,
BEIREvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: BEIREvalArgs
model_args: BEIREvalModelArgs

runner = BEIREvalRunner(
eval_args=eval_args,
model_args=model_args
)
def main():
parser = HfArgumentParser((
BEIREvalArgs,
BEIREvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: BEIREvalArgs
model_args: BEIREvalModelArgs

runner = BEIREvalRunner(
eval_args=eval_args,
model_args=model_args
)

runner.run()


runner.run()
if __name__ == "__main__":
main()
33 changes: 19 additions & 14 deletions FlagEmbedding/evaluation/custom/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
)


parser = HfArgumentParser((
CustomEvalArgs,
CustomEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: CustomEvalArgs
model_args: CustomEvalModelArgs

runner = CustomEvalRunner(
eval_args=eval_args,
model_args=model_args
)
def main():
parser = HfArgumentParser((
CustomEvalArgs,
CustomEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: CustomEvalArgs
model_args: CustomEvalModelArgs

runner = CustomEvalRunner(
eval_args=eval_args,
model_args=model_args
)

runner.run()


runner.run()
if __name__ == "__main__":
main()
33 changes: 19 additions & 14 deletions FlagEmbedding/evaluation/miracl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
)


parser = HfArgumentParser((
MIRACLEvalArgs,
MIRACLEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: MIRACLEvalArgs
model_args: MIRACLEvalModelArgs

runner = MIRACLEvalRunner(
eval_args=eval_args,
model_args=model_args
)
def main():
parser = HfArgumentParser((
MIRACLEvalArgs,
MIRACLEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: MIRACLEvalArgs
model_args: MIRACLEvalModelArgs

runner = MIRACLEvalRunner(
eval_args=eval_args,
model_args=model_args
)

runner.run()


runner.run()
if __name__ == "__main__":
main()
33 changes: 19 additions & 14 deletions FlagEmbedding/evaluation/mkqa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
)


parser = HfArgumentParser((
MKQAEvalArgs,
MKQAEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: MKQAEvalArgs
model_args: MKQAEvalModelArgs

runner = MKQAEvalRunner(
eval_args=eval_args,
model_args=model_args
)
def main():
parser = HfArgumentParser((
MKQAEvalArgs,
MKQAEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: MKQAEvalArgs
model_args: MKQAEvalModelArgs

runner = MKQAEvalRunner(
eval_args=eval_args,
model_args=model_args
)

runner.run()


runner.run()
if __name__ == "__main__":
main()
33 changes: 19 additions & 14 deletions FlagEmbedding/evaluation/mldr/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
)


parser = HfArgumentParser((
MLDREvalArgs,
MLDREvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: MLDREvalArgs
model_args: MLDREvalModelArgs

runner = MLDREvalRunner(
eval_args=eval_args,
model_args=model_args
)
def main():
parser = HfArgumentParser((
MLDREvalArgs,
MLDREvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: MLDREvalArgs
model_args: MLDREvalModelArgs

runner = MLDREvalRunner(
eval_args=eval_args,
model_args=model_args
)

runner.run()


runner.run()
if __name__ == "__main__":
main()
33 changes: 19 additions & 14 deletions FlagEmbedding/evaluation/msmarco/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
)


parser = HfArgumentParser((
MSMARCOEvalArgs,
MSMARCOEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: MSMARCOEvalArgs
model_args: MSMARCOEvalModelArgs

runner = MSMARCOEvalRunner(
eval_args=eval_args,
model_args=model_args
)
def main():
parser = HfArgumentParser((
MSMARCOEvalArgs,
MSMARCOEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: MSMARCOEvalArgs
model_args: MSMARCOEvalModelArgs

runner = MSMARCOEvalRunner(
eval_args=eval_args,
model_args=model_args
)

runner.run()


runner.run()
if __name__ == "__main__":
main()
33 changes: 19 additions & 14 deletions FlagEmbedding/evaluation/mteb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
)


parser = HfArgumentParser((
MTEBEvalArgs,
MTEBEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: MTEBEvalArgs
model_args: MTEBEvalModelArgs

runner = MTEBEvalRunner(
eval_args=eval_args,
model_args=model_args
)
def main():
parser = HfArgumentParser((
MTEBEvalArgs,
MTEBEvalModelArgs
))

eval_args, model_args = parser.parse_args_into_dataclasses()
eval_args: MTEBEvalArgs
model_args: MTEBEvalModelArgs

runner = MTEBEvalRunner(
eval_args=eval_args,
model_args=model_args
)

runner.run()


runner.run()
if __name__ == "__main__":
main()
35 changes: 20 additions & 15 deletions FlagEmbedding/finetune/embedder/decoder_only/base/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@
)


parser = HfArgumentParser((
DecoderOnlyEmbedderModelArguments,
DecoderOnlyEmbedderDataArguments,
DecoderOnlyEmbedderTrainingArguments
))
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
model_args: DecoderOnlyEmbedderModelArguments
data_args: DecoderOnlyEmbedderDataArguments
training_args: DecoderOnlyEmbedderTrainingArguments
def main():
parser = HfArgumentParser((
DecoderOnlyEmbedderModelArguments,
DecoderOnlyEmbedderDataArguments,
DecoderOnlyEmbedderTrainingArguments
))
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
model_args: DecoderOnlyEmbedderModelArguments
data_args: DecoderOnlyEmbedderDataArguments
training_args: DecoderOnlyEmbedderTrainingArguments

runner = DecoderOnlyEmbedderRunner(
model_args=model_args,
data_args=data_args,
training_args=training_args
)
runner.run()
runner = DecoderOnlyEmbedderRunner(
model_args=model_args,
data_args=data_args,
training_args=training_args
)
runner.run()


if __name__ == "__main__":
main()
35 changes: 20 additions & 15 deletions FlagEmbedding/finetune/embedder/decoder_only/icl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@
)


parser = HfArgumentParser((
DecoderOnlyEmbedderICLModelArguments,
DecoderOnlyEmbedderICLDataArguments,
DecoderOnlyEmbedderICLTrainingArguments
))
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
model_args: DecoderOnlyEmbedderICLModelArguments
data_args: DecoderOnlyEmbedderICLDataArguments
training_args: DecoderOnlyEmbedderICLTrainingArguments
def main():
parser = HfArgumentParser((
DecoderOnlyEmbedderICLModelArguments,
DecoderOnlyEmbedderICLDataArguments,
DecoderOnlyEmbedderICLTrainingArguments
))
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
model_args: DecoderOnlyEmbedderICLModelArguments
data_args: DecoderOnlyEmbedderICLDataArguments
training_args: DecoderOnlyEmbedderICLTrainingArguments

runner = DecoderOnlyEmbedderICLRunner(
model_args=model_args,
data_args=data_args,
training_args=training_args
)
runner.run()
runner = DecoderOnlyEmbedderICLRunner(
model_args=model_args,
data_args=data_args,
training_args=training_args
)
runner.run()


if __name__ == "__main__":
main()
Loading

0 comments on commit 9abcfc8

Please sign in to comment.