Spaces:
Runtime error
Runtime error
hanzla javaid commited on
Commit ·
def2e7f
1
Parent(s): e9d2334
test
Browse files
app.py
CHANGED
|
@@ -35,12 +35,6 @@ def chat(message, history, model1, model2):
|
|
| 35 |
return [(message, f"{model1}: {response1}\n\n{model2}: {response2}")]
|
| 36 |
|
| 37 |
|
| 38 |
-
def vote(direction, history):
|
| 39 |
-
if history:
|
| 40 |
-
last_message = history[-1]
|
| 41 |
-
vote_text = f"\n\nUser voted: {'👍' if direction == 'up' else '👎'}"
|
| 42 |
-
last_message["content"] += vote_text
|
| 43 |
-
return history
|
| 44 |
|
| 45 |
|
| 46 |
with gr.Blocks() as demo:
|
|
@@ -60,8 +54,6 @@ with gr.Blocks() as demo:
|
|
| 60 |
|
| 61 |
msg.submit(chat, [msg, chatbot, model1_dropdown, model2_dropdown], chatbot)
|
| 62 |
clear.click(lambda: [], None, chatbot, queue=False)
|
| 63 |
-
upvote.click(vote, ["up", chatbot], chatbot)
|
| 64 |
-
downvote.click(vote, ["down", chatbot], chatbot)
|
| 65 |
|
| 66 |
if __name__ == "__main__":
|
| 67 |
demo.launch()
|
|
|
|
| 35 |
return [(message, f"{model1}: {response1}\n\n{model2}: {response2}")]
|
| 36 |
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
with gr.Blocks() as demo:
|
|
|
|
| 54 |
|
| 55 |
msg.submit(chat, [msg, chatbot, model1_dropdown, model2_dropdown], chatbot)
|
| 56 |
clear.click(lambda: [], None, chatbot, queue=False)
|
|
|
|
|
|
|
| 57 |
|
| 58 |
if __name__ == "__main__":
|
| 59 |
demo.launch()
|