YangLing0818/RPG-DiffusionMaster

It is wrong with gpt4 api?

Seyanliu opened this issue · 1 comments

Traceback (most recent call last):
  File "/data/liusy/RPG-DiffusionMaster/RPG.py", line 235, in <module>
    image=RPG(user_prompt=user_prompt,
  File "/data/liusy/RPG-DiffusionMaster/RPG.py", line 90, in RPG
    params=GPT4(input_prompt,version,key)
  File "/data/liusy/RPG-DiffusionMaster/mllm.py", line 50, in GPT4
    text=obj['choices'][0]['message']['content']
KeyError: 'choices'

Thank you for your attention for our project, I have just tested our code, and it seems works well without the problem you mentioned. For this issue, the potential causes could stem from an expired API key leading to response errors, a lack of GPT-4 authorization, or perhaps due to network issues. In any case, the most direct approach would be to print the response's returned object. In this way, you can probably find out the specific underlying reasons for the error.