Spaces:
Configuration error
Configuration error
Download evaluation/benchmarks/gaia/get_score.py from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 727 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/evaluation/benchmarks/gaia/get_score.py
- Command line
-
hf download hf://spaces/flyingdarkdev/README/evaluation/benchmarks/gaia/get_score.py
-
curl -L -o get_score.py https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/evaluation/benchmarks/gaia/get_score.py
727 Bytes
| import argparse | |
| import json | |
| def main(): | |
| parser = argparse.ArgumentParser(description="Get agent's gaia score") | |
| parser.add_argument('--file', type=str, help="Path to the agent's output.jsonl") | |
| args = parser.parse_args() | |
| this_log = args.file | |
| outs = [] | |
| with open(this_log, 'r') as f: | |
| lines = f.readlines() | |
| for line in lines: | |
| outs.append(json.loads(line)) | |
| print(f'Reading {this_log}') | |
| print(f'Metadata:\n {outs[0]["metadata"]}') | |
| total = 0 | |
| success = 0 | |
| for out in outs: | |
| total += 1 | |
| if out['test_result']['score']: | |
| success += 1 | |
| print(f'Success rate: {success}/{total} = {success/total}') | |
| if __name__ == '__main__': | |
| main() | |