mirror of
https://github.com/Vision-CAIR/MiniGPT-4.git
synced 2025-04-05 18:40:46 +00:00
set num_beam default to 1 instead of completely removing it
This commit is contained in:
parent
6a8e6e49ff
commit
700f05d079
4
demo.py
4
demo.py
@ -113,8 +113,8 @@ with gr.Blocks() as demo:
|
|||||||
|
|
||||||
num_beams = gr.Slider(
|
num_beams = gr.Slider(
|
||||||
minimum=1,
|
minimum=1,
|
||||||
maximum=16,
|
maximum=10,
|
||||||
value=5,
|
value=1,
|
||||||
step=1,
|
step=1,
|
||||||
interactive=True,
|
interactive=True,
|
||||||
label="beam search numbers)",
|
label="beam search numbers)",
|
||||||
|
@ -134,7 +134,7 @@ class Chat:
|
|||||||
else:
|
else:
|
||||||
conv.append_message(conv.roles[0], text)
|
conv.append_message(conv.roles[0], text)
|
||||||
|
|
||||||
def answer(self, conv, img_list, max_new_tokens=200, num_beams=5, min_length=1, top_p=0.9,
|
def answer(self, conv, img_list, max_new_tokens=200, num_beams=1, min_length=1, top_p=0.9,
|
||||||
repetition_penalty=1.0, length_penalty=1, temperature=1.0):
|
repetition_penalty=1.0, length_penalty=1, temperature=1.0):
|
||||||
conv.append_message(conv.roles[1], None)
|
conv.append_message(conv.roles[1], None)
|
||||||
embs = self.get_context_emb(conv, img_list)
|
embs = self.get_context_emb(conv, img_list)
|
||||||
@ -142,7 +142,7 @@ class Chat:
|
|||||||
inputs_embeds=embs,
|
inputs_embeds=embs,
|
||||||
max_new_tokens=max_new_tokens,
|
max_new_tokens=max_new_tokens,
|
||||||
stopping_criteria=self.stopping_criteria,
|
stopping_criteria=self.stopping_criteria,
|
||||||
#num_beams=num_beams,
|
num_beams=num_beams,
|
||||||
do_sample=True,
|
do_sample=True,
|
||||||
min_length=min_length,
|
min_length=min_length,
|
||||||
top_p=top_p,
|
top_p=top_p,
|
||||||
|
Loading…
Reference in New Issue
Block a user