Merge pull request #378 from TsuTikgiau/main

fix the temperature error that kills the demo
This commit is contained in:
ZhuDeyao 2023-10-16 16:03:30 +03:00 committed by GitHub
commit a2f0a447db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -549,7 +549,7 @@ with gr.Blocks() as demo:
temperature = gr.Slider( temperature = gr.Slider(
minimum=0.1, minimum=0.1,
maximum=2.0, maximum=1.5,
value=1.0, value=1.0,
step=0.1, step=0.1,
interactive=True, interactive=True,

View File

@ -170,7 +170,7 @@ class Chat:
top_p=top_p, top_p=top_p,
repetition_penalty=repetition_penalty, repetition_penalty=repetition_penalty,
length_penalty=length_penalty, length_penalty=length_penalty,
temperature=temperature, temperature=float(temperature),
) )
return generation_kwargs return generation_kwargs

View File

@ -7,6 +7,7 @@ import torch.nn as nn
from minigpt4.common.registry import registry from minigpt4.common.registry import registry
from minigpt4.models.base_model import BaseModel from minigpt4.models.base_model import BaseModel
from transformers import StoppingCriteria, StoppingCriteriaList
@ -365,8 +366,8 @@ class MiniGPTBase(BaseModel):
do_sample=do_sample, do_sample=do_sample,
min_length=min_length, min_length=min_length,
top_p=top_p, top_p=top_p,
repetition_penalty=repetition_penalty repetition_penalty=repetition_penalty,
# stopping_criteria=stopping_criteria, stopping_criteria=stopping_criteria,
) )
answers = [] answers = []