shizhediao / Black-Box-Prompt-Learning

Source code for the TMLR paper "Black-Box Prompt Learning for Pre-trained Language Models"
Apache License 2.0
55 stars 7 forks source link

train_api_request和complete_gpt3区别在哪 #2

Closed steveluo01 closed 1 year ago

steveluo01 commented 1 year ago
    for m, missing_batch in enumerate(batches['sentence']):
        if split == "train":
            missing_response = train_api_request(missing_batch, l=0, model_name=args.model_name_or_path, num_log_probs=1, echo=True)
        else: 
            missing_response = complete_gpt3(missing_batch, l=0, model_name=args.model_name_or_path, num_log_probs=1, echo=True)

train_api_request和complete_gpt3区别在哪

shizhediao commented 1 year ago

感谢关注! train_api_request的目的是为了计算API调用次数,于是在complete_gpt3的外层套了一个counter。


Thanks for attention! The purpose of train_api_request is to count the number of API calls, so a counter is set in the outer layer of complete_gpt3.