Spaces:
Sleeping
Sleeping
update
Browse files
examples/api_eval/eval_gemini_google.py
CHANGED
|
@@ -19,6 +19,7 @@ def get_args():
|
|
| 19 |
"""
|
| 20 |
python3 eval_gemini_google.py --model_name gemini-2.5-pro --eval_result eval_math_result_gemini-2.5-pro.jsonl
|
| 21 |
python3 eval_gemini_google.py --model_name gemini-2.5-flash --eval_result eval_math_result_gemini-2.5-flash.jsonl
|
|
|
|
| 22 |
:return:
|
| 23 |
"""
|
| 24 |
parser = argparse.ArgumentParser()
|
|
@@ -82,7 +83,7 @@ def main():
|
|
| 82 |
|
| 83 |
with open(args.eval_data, "r", encoding="utf-8") as fin, open(args.eval_result, "a+", encoding="utf-8") as fout:
|
| 84 |
for row in fin:
|
| 85 |
-
if total >
|
| 86 |
break
|
| 87 |
|
| 88 |
row = json.loads(row)
|
|
@@ -132,7 +133,7 @@ Your output is:
|
|
| 132 |
config=generate_content_config,
|
| 133 |
)
|
| 134 |
time_cost = time.time() - time_begin
|
| 135 |
-
|
| 136 |
try:
|
| 137 |
prediction = response.candidates[0].content.parts[0].text
|
| 138 |
except TypeError:
|
|
@@ -158,7 +159,7 @@ Your output is:
|
|
| 158 |
row_ = json.dumps(row_, ensure_ascii=False)
|
| 159 |
fout.write(f"{row_}\n")
|
| 160 |
|
| 161 |
-
print(f"score: {score}")
|
| 162 |
|
| 163 |
return
|
| 164 |
|
|
|
|
| 19 |
"""
|
| 20 |
python3 eval_gemini_google.py --model_name gemini-2.5-pro --eval_result eval_math_result_gemini-2.5-pro.jsonl
|
| 21 |
python3 eval_gemini_google.py --model_name gemini-2.5-flash --eval_result eval_math_result_gemini-2.5-flash.jsonl
|
| 22 |
+
python3 eval_gemini_google.py --model_name gemini-2.5-flash-lite-preview-06-17 --eval_result eval_math_result_gemini-2.5-flash-lite-preview-06-17.jsonl
|
| 23 |
:return:
|
| 24 |
"""
|
| 25 |
parser = argparse.ArgumentParser()
|
|
|
|
| 83 |
|
| 84 |
with open(args.eval_data, "r", encoding="utf-8") as fin, open(args.eval_result, "a+", encoding="utf-8") as fout:
|
| 85 |
for row in fin:
|
| 86 |
+
if total > 20:
|
| 87 |
break
|
| 88 |
|
| 89 |
row = json.loads(row)
|
|
|
|
| 133 |
config=generate_content_config,
|
| 134 |
)
|
| 135 |
time_cost = time.time() - time_begin
|
| 136 |
+
print(time_cost)
|
| 137 |
try:
|
| 138 |
prediction = response.candidates[0].content.parts[0].text
|
| 139 |
except TypeError:
|
|
|
|
| 159 |
row_ = json.dumps(row_, ensure_ascii=False)
|
| 160 |
fout.write(f"{row_}\n")
|
| 161 |
|
| 162 |
+
# print(f"score: {score}")
|
| 163 |
|
| 164 |
return
|
| 165 |
|