Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurs for parsing gpt4's response #50

Open
Genie-Kim opened this issue May 23, 2024 · 4 comments
Open

Error occurs for parsing gpt4's response #50

Genie-Kim opened this issue May 23, 2024 · 4 comments

Comments

@Genie-Kim
Copy link

Genie-Kim commented May 23, 2024

Thanks for sharing your great work.

However, when I run RPG.py, I get an error like below.

NameError: name 'final_split_ratio' is not defined

I've tried changing the regex in mllm.py's get_params_dict function, but gpt4's response is giving me a response that doesn't match it, so I frequently get parsing errors.
like this :

### Final Output

**Overall split ratio:**
1;1;1

This is also the case with the regional prompt.

If anyone has solved this, please help😭

@CindyTing
Copy link

Similar Error I got,

Traceback (most recent call last): File "/run/determined/workdir/home/RPG-DiffusionMaster/test.py", line 51, in <module> images = pipe( File "/opt/conda/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/run/determined/workdir/home/RPG-DiffusionMaster/RegionalDiffusion_base.py", line 901, in __call__ matrixdealer(self,self.split_ratio,self.base_ratio) File "/run/determined/workdir/home/RPG-DiffusionMaster/matrix.py", line 248, in matrixdealer baseratio = baseratio2

UnboundLocalError: local variable 'baseratio2' referenced before assignment

@HuiZhang0812
Copy link

I have also encountered similar problems, whether using llama or gpt4.

@amerk12
Copy link

amerk12 commented Aug 1, 2024

I am also observing similar problems. Sometimes the GPT4 output has:

#### c. Overall Ratio:
We need to combine the heights and widths in the specified format.
- Row0_height,Row0_region0_width,Row0_region1_width;Row1_height,Row1_region2_width,Row1_region3_width
- Final split ratio: 0.5,0.5,0.5;0.5,0.5,0.5

And split_ratio_match = re.search(r"Final split ratio: ([\d.,;]+)", response) in mllm.get_params_dict(output_text) can find the split ratio.

Other times the GPT4 output just has:

 ### Final Output 
 - **Final Split Ratio:** 0.5,0.5,0.5;0.5,0.5,0.5

And split_ratio_match = re.search(r"Final split ratio: ([\d.,;]+)", response) in mllm.get_params_dict(output_text) doesn't find anything, even though we see the data is there.

I'm not understanding why the same prompt returns inconsistent output text. This is using the example prompt: ' A handsome young man with blonde curly hair and black suit with a black twintail girl in red cheongsam in the bar.'

@amerk12
Copy link

amerk12 commented Aug 1, 2024

For whatever reason I encounter fewer of these parsing errors using the gpt-4o-mini or older gpt-4 models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants