parent
76fff757b6
commit
8de4c76203
|
@ -105,6 +105,8 @@ def predict(history, prompt, max_length, top_p, temperature):
|
|||
if prompt:
|
||||
messages.append({"role": "system", "content": prompt})
|
||||
for idx, (user_msg, model_msg) in enumerate(history):
|
||||
if prompt and idx == 0:
|
||||
continue
|
||||
if idx == len(history) - 1 and not model_msg:
|
||||
messages.append({"role": "user", "content": user_msg})
|
||||
break
|
||||
|
@ -173,4 +175,4 @@ with gr.Blocks() as demo:
|
|||
emptyBtn.click(lambda: (None, None), None, [chatbot, prompt_input], queue=False)
|
||||
|
||||
demo.queue()
|
||||
demo.launch(server_name="127.0.0.1", server_port=8000, inbrowser=True, share=True)
|
||||
demo.launch(server_name="127.0.0.1", server_port=8000, inbrowser=True, share=True)
|
||||
|
|
Loading…
Reference in New Issue