Skip to content

千问模型429限制, AI model API request limitations. #526

Description

@Xing-He

API 调用极易触发平台访问限制检测,如下:

Translation attempt 1 failed: Error code: 429 - {'error': {'message': 'You have exceeded your current request limit. For details, see: https://help.aliyun.com/zh/model-studio/error-code#rate-limit', 'type': 
'limit_requests', 'param': None, 'code': 'limit_requests'}   

可以尝试增加 retry的次数和休眠,增加翻译成功率

  • qwen_translator.py
+ max_attempts = 5

...

except Exception as e:
    ...
    else:
+        time.sleep(10) # 触发最大重试次数时,休眠10s

+  time.sleep(0.2) # 每调用一次API休眠0.2s
return t_text

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions