Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bugs and refactor code #1231

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading