Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Conversation

@Gasoonjia
Copy link
Contributor

@Gasoonjia Gasoonjia commented Oct 23, 2024

Currently image_prompt variable in the error message doesn't exist, blocking error msg to be printed out:

Traceback (most recent call last):
  File "/home/gasoonjia/torchchat/torchchat.py", line 88, in <module>
    generate_main(args)
  File "/home/gasoonjia/torchchat/torchchat/generate.py", line 1249, in main
    generator_args = GeneratorArgs.from_args(args)
  File "/home/gasoonjia/torchchat/torchchat/generate.py", line 184, in from_args
    raise RuntimeError(f"Image prompt {image_prompt} does not exist")
NameError: name 'image_prompt' is not defined. Did you mean: 'image_prompts'?

After this PR:

(torchchat) [gasoonjia ~/torchchat (image-prompt-bug)]$ python torchchat.py generate llama3.2-11B --prompt "What's in this image?" --image-prompt assets/NO_EXIST_IMG.jpg
Traceback (most recent call last):
  File "/home/gasoonjia/torchchat/torchchat.py", line 88, in <module>
    generate_main(args)
  File "/home/gasoonjia/torchchat/torchchat/generate.py", line 1225, in main
    generator_args = GeneratorArgs.from_args(args)
  File "/home/gasoonjia/torchchat/torchchat/generate.py", line 188, in from_args
    raise RuntimeError(
RuntimeError: Image prompt ['assets/NO_EXIST_IMG.jpg'] does not exist

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 23, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchchat/1322

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 2f52a9f with merge base 76c1cd2 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 23, 2024
@Gasoonjia Gasoonjia requested review from Jack-Khuu and vmpuri October 23, 2024 18:47
@Gasoonjia Gasoonjia changed the title print non-existence image prompt raise error with non-existence image prompts Oct 23, 2024
@Gasoonjia Gasoonjia requested a review from byjlw October 23, 2024 18:54
@Gasoonjia Gasoonjia merged commit 7fe2c86 into main Oct 23, 2024
52 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants