Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	错误情况处理
Browse files
    	
        request_llm/bridge_chatgpt.py
    CHANGED
    
    | @@ -196,6 +196,8 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp | |
| 196 | 
             
                                    chatbot[-1] = (chatbot[-1][0], "[Local Message] Incorrect API key. OpenAI以提供了不正确的API_KEY为由,拒绝服务.")
         | 
| 197 | 
             
                                elif "exceeded your current quota" in error_msg:
         | 
| 198 | 
             
                                    chatbot[-1] = (chatbot[-1][0], "[Local Message] You exceeded your current quota. OpenAI以账户额度不足为由,拒绝服务.")
         | 
|  | |
|  | |
| 199 | 
             
                                else:
         | 
| 200 | 
             
                                    from toolbox import regular_txt_to_markdown
         | 
| 201 | 
             
                                    tb_str = '```\n' + traceback.format_exc() + '```'
         | 
|  | |
| 196 | 
             
                                    chatbot[-1] = (chatbot[-1][0], "[Local Message] Incorrect API key. OpenAI以提供了不正确的API_KEY为由,拒绝服务.")
         | 
| 197 | 
             
                                elif "exceeded your current quota" in error_msg:
         | 
| 198 | 
             
                                    chatbot[-1] = (chatbot[-1][0], "[Local Message] You exceeded your current quota. OpenAI以账户额度不足为由,拒绝服务.")
         | 
| 199 | 
            +
                                elif "bad forward key" in error_msg:
         | 
| 200 | 
            +
                                    chatbot[-1] = (chatbot[-1][0], "[Local Message] Bad forward key. API2D账户额度不足.")
         | 
| 201 | 
             
                                else:
         | 
| 202 | 
             
                                    from toolbox import regular_txt_to_markdown
         | 
| 203 | 
             
                                    tb_str = '```\n' + traceback.format_exc() + '```'
         |