Spaces:
Build error
Build error
Update app.py
Browse files63 unmodified lines64656667686970717213 unmodified lines868788899091929394959697989910010110263 unmodified linesprint(f'history: {history}')conversation = []for prompt, answer in history:conversation.append(UserMessage(content=prompt))conversation.append(AssistantMessage(content=answer))conversation.append(UserMessage(content=message))completion_request = ChatCompletionRequest(messages=conversation)13 unmodified linestime.sleep(0.05)yield result[: i + 1]chatbot = gr.Chatbot(height=600,placeholder=PLACEHOLDER)with gr.Blocks(theme="ocean", css=CSS) as demo:gr.HTML(TITLE)gr.DuplicateButton(value="Duplicate Space for private use", elem_classes="duplicate-button")gr.ChatInterface(fn=stream_chat,chatbot=chatbot,examples=[["Help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option."],["What are 5 creative things I could do with my kids' art? I don't want to throw them away, but it's also so much clutter."],63 unmodified lines646566676869707172737413 unmodified lines88899091929394959697989910063 unmodified linesprint(f'history: {history}')conversation = []# for prompt, answer in history:# conversation.append(UserMessage(content=prompt))# conversation.append(AssistantMessage(content=answer))if history:conversation.extend(history)conversation.append(UserMessage(content=message))completion_request = ChatCompletionRequest(messages=conversation)13 unmodified linestime.sleep(0.05)yield result[: i + 1]with gr.Blocks(theme="ocean", css=CSS) as demo:gr.HTML(TITLE)gr.DuplicateButton(value="Duplicate Space for private use", elem_classes="duplicate-button")gr.ChatInterface(fn=stream_chat,type="messages",fill_height=True,examples=[["Help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option."],["What are 5 creative things I could do with my kids' art? I don't want to throw them away, but it's also so much clutter."],
app.py+7-9