FastChat icon indicating copy to clipboard operation
FastChat copied to clipboard

TypeError: string indices must be integers

Open adamsah opened this issue 2 years ago • 8 comments
trafficstars

Use the Python openai to call the FastChat API + baichuan2-13B, then I received the "TypeError: string indices must be integers" error

The full error message: """ Traceback (most recent call last): File "C:\Users\Adams\anaconda3\lib\site-packages\openai\api_requestor.py", line 413, in handle_error_response error_data = resp["error"] TypeError: string indices must be integers

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:/Programs/20230927/LLM/api_sample_test.py", line 13, in completion = openai.Completion.create(model=model, prompt=prompt, max_tokens=64) File "C:\Users\Adams\anaconda3\lib\site-packages\openai\api_resources\completion.py", line 25, in create return super().create(*args, **kwargs) File "C:\Users\Adams\anaconda3\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 155, in create response, _, api_key = requestor.request( File "C:\Users\Adams\anaconda3\lib\site-packages\openai\api_requestor.py", line 299, in request resp, got_stream = self._interpret_response(result, stream) File "C:\Users\Adams\anaconda3\lib\site-packages\openai\api_requestor.py", line 710, in _interpret_response self._interpret_response_line( File "C:\Users\Adams\anaconda3\lib\site-packages\openai\api_requestor.py", line 775, in _interpret_response_line raise self.handle_error_response( File "C:\Users\Adams\anaconda3\lib\site-packages\openai\api_requestor.py", line 415, in handle_error_response raise error.APIError( openai.error.APIError: Invalid response object from API: 'Internal Server Error' (HTTP response code was 500)

Process finished with exit code 1 """

adamsah avatar Nov 08 '23 14:11 adamsah