()
| 112 | return correct |
| 113 | |
| 114 | async def main(): |
| 115 | model_name = "aguivs" |
| 116 | total = 0 |
| 117 | correct = 0 |
| 118 | json_data_path = "your/path/to/the/dataset" |
| 119 | data = read_jsonl(json_data_path) |
| 120 | client = AsyncClient(api_key="sk-123", base_url='http://localhost:8000/v1') |
| 121 | semaphore = asyncio.Semaphore(16) |
| 122 | tasks = [] |
| 123 | for item in data: |
| 124 | task = asyncio.create_task(process_item_async(item, client, model_name,semaphore)) |
| 125 | tasks.append(task) |
| 126 | |
| 127 | results = await asyncio.gather(*tasks) |
| 128 | for result in results: |
| 129 | correct += result |
| 130 | total += 1 |
| 131 | print(correct, total, correct / total) |
| 132 | |
| 133 | return 0 |
| 134 | |
| 135 | if __name__=="__main__": |
| 136 | asyncio.run(main()) |
no test coverage detected