YangLing0818 / RPG-DiffusionMaster

[ICML 2024] Mastering Text-to-Image Diffusion: Recaptioning, Planning, and Generating with Multimodal LLMs (RPG)
https://proceedings.mlr.press/v235/yang24ai.html
MIT License
1.7k stars 99 forks source link

It is wrong with gpt4 api? #37

Open Seyanliu opened 8 months ago

Seyanliu commented 8 months ago
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'
ZhaochenYu0201 commented 8 months ago

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.