()
| 96 | return correct |
| 97 | |
| 98 | async def main(): |
| 99 | model_name = "aguivs" |
| 100 | total = 0 |
| 101 | correct = 0 |
| 102 | json_data_path = "your/path/to/the/dataset" |
| 103 | data = read_jsonl(json_data_path) |
| 104 | client = AsyncClient(api_key="sk-123", base_url='http://localhost:8000/v1') |
| 105 | semaphore = asyncio.Semaphore(16) |
| 106 | tasks = [] |
| 107 | for item in data: |
| 108 | task = asyncio.create_task(process_item_async(item, client, model_name,semaphore)) |
| 109 | tasks.append(task) |
| 110 | |
| 111 | results = await asyncio.gather(*tasks) |
| 112 | for result in results: |
| 113 | correct += result |
| 114 | total += 1 |
| 115 | print(correct, total, correct / total) |
| 116 | |
| 117 | return 0 |
| 118 | |
| 119 | if __name__=="__main__": |
| 120 | asyncio.run(main()) |
no test coverage detected