Unispac / Visual-Adversarial-Examples-Jailbreak-Large-Language-Models

Repository for the Paper (AAAI 2024, Oral) --- Visual Adversarial Examples Jailbreak Large Language Models
165 stars 12 forks source link

how to use nucleus sampling in minigpt4? #13

Closed roywang021 closed 6 months ago

roywang021 commented 6 months ago

Great job, thank you. However, I couldn't find how to set up nucleus sampling in the test code for MiniGPT4. Could you provide some guidance?

Unispac commented 6 months ago

Thanks for the question. Please refer to the constructor of the Generator class:

https://github.com/Unispac/Visual-Adversarial-Examples-Jailbreak-Large-Language-Models/blob/main/minigpt_utils/generator.py

You can pass top_p / temperature parameters to control it.