Spaces:
Build error
Build error
Update app.py
Browse files42 unmodified lines434445464748495051525354555623 unmodified lines808182838485863 unmodified lines909192939495969 unmodified lines10610710810911011111242 unmodified linesmodel = model.eval()@spaces.GPU()def stream_chat(message: str, history: list, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):for resp, history in model.stream_chat(tokenizer,query = message,history = history,max_new_tokens = max_new_tokens,do_sample = True if temperature == 0 else False,top_p = top_p,top_k = top_k,temperature = temperature,23 unmodified lines),gr.Slider(minimum=128,maximum=2048,step=1,value=1024,label="Max New Tokens",3 unmodified linesminimum=0.0,maximum=1.0,step=0.1,value=0.8,label="top_p",render=False,),9 unmodified linesminimum=0.0,maximum=2.0,step=0.1,value=1.0,label="Repetition penalty",render=False,),42 unmodified lines434445464748495051525354555657585960616263646523 unmodified lines899091929394953 unmodified lines991001011021031041059 unmodified lines11511611711811912012142 unmodified linesmodel = model.eval()@spaces.GPU()def stream_chat(message: str,history: list,temperature: float = 0.8,max_new_tokens: int = 1024,top_p: float = 1.0,top_k: int = 20,penalty: float = 1.2):print(f'message: {message}')print(f'history: {history}')for resp, history in model.stream_chat(tokenizer,query = message,history = history,max_new_tokens = max_new_tokens,do_sample = False if temperature == 0 else True,top_p = top_p,top_k = top_k,temperature = temperature,23 unmodified lines),gr.Slider(minimum=128,maximum=8192,step=1,value=1024,label="Max New Tokens",3 unmodified linesminimum=0.0,maximum=1.0,step=0.1,value=1.0,label="top_p",render=False,),9 unmodified linesminimum=0.0,maximum=2.0,step=0.1,value=1.2,label="Repetition penalty",render=False,),
app.py+15-6