#多线程对LLM进行评估 import json import threading from tqdm import tqdm import concurrent.futures from openai import OpenAI client = OpenAI( api_key="sk-oYh3Xrhg8oDY2gW02c966f31C84449Ad86F9Cd9dF6E64a8d", base_url="https://vip.apiyi.com/v1" ) # 创建一个线程锁,用于保护共享资源 thread_lock = threading.Lock() def load_json_data(filepath): with open(filepath, 'r') as file: data = json.load(file) return data def get_response(question,max_retries=10): retries = 0 while retries