mirror of
https://github.com/Vision-CAIR/MiniGPT-4.git
synced 2025-04-05 02:20:47 +00:00
Merge pull request #378 from TsuTikgiau/main
fix the temperature error that kills the demo
This commit is contained in:
commit
a2f0a447db
@ -549,7 +549,7 @@ with gr.Blocks() as demo:
|
||||
|
||||
temperature = gr.Slider(
|
||||
minimum=0.1,
|
||||
maximum=2.0,
|
||||
maximum=1.5,
|
||||
value=1.0,
|
||||
step=0.1,
|
||||
interactive=True,
|
||||
|
@ -170,7 +170,7 @@ class Chat:
|
||||
top_p=top_p,
|
||||
repetition_penalty=repetition_penalty,
|
||||
length_penalty=length_penalty,
|
||||
temperature=temperature,
|
||||
temperature=float(temperature),
|
||||
)
|
||||
return generation_kwargs
|
||||
|
||||
|
@ -7,6 +7,7 @@ import torch.nn as nn
|
||||
|
||||
from minigpt4.common.registry import registry
|
||||
from minigpt4.models.base_model import BaseModel
|
||||
from transformers import StoppingCriteria, StoppingCriteriaList
|
||||
|
||||
|
||||
|
||||
@ -365,8 +366,8 @@ class MiniGPTBase(BaseModel):
|
||||
do_sample=do_sample,
|
||||
min_length=min_length,
|
||||
top_p=top_p,
|
||||
repetition_penalty=repetition_penalty
|
||||
# stopping_criteria=stopping_criteria,
|
||||
repetition_penalty=repetition_penalty,
|
||||
stopping_criteria=stopping_criteria,
|
||||
)
|
||||
|
||||
answers = []
|
||||
|
Loading…
Reference in New Issue
Block a user