artificialguybr
commited on
Commit
•
64a1eae
1
Parent(s):
97d4bb3
Update app.py
Browse files
app.py
CHANGED
@@ -98,13 +98,12 @@ with gr.Blocks() as demo:
|
|
98 |
<p> <strong>HF Created by:</strong> @artificialguybr (<a href="https://twitter.com/artificialguybr">Twitter</a>)</p>
|
99 |
<p> <strong>Discover more:</strong> <a href="https://artificialguy.com">artificialguy.com</a></p>
|
100 |
"""
|
|
|
101 |
gr.Markdown(description)
|
102 |
-
chatbox = gr.Textbox(label="What do you want to chat about?", placeholder="Ask me anything.", lines=3)
|
103 |
chat_history_state = gr.State([])
|
104 |
|
105 |
chatbot = gr.ChatInterface(
|
106 |
fn=lambda message, history: update_chatbot(message, history, system_msg.value, max_tokens.value, temperature.value, top_p.value),
|
107 |
-
textbox=chatbox, # Use the chatbox created within the Blocks context
|
108 |
additional_inputs=[system_msg, max_tokens, temperature, top_p],
|
109 |
title="LLAMA 2 70B Chatbot",
|
110 |
submit_btn="Submit",
|
@@ -113,8 +112,8 @@ with gr.Blocks() as demo:
|
|
113 |
|
114 |
chatbot.clear(
|
115 |
fn=clear_chat,
|
116 |
-
inputs=[chat_history_state,
|
117 |
-
outputs=[chat_history_state,
|
118 |
)
|
119 |
|
120 |
demo.launch()
|
|
|
98 |
<p> <strong>HF Created by:</strong> @artificialguybr (<a href="https://twitter.com/artificialguybr">Twitter</a>)</p>
|
99 |
<p> <strong>Discover more:</strong> <a href="https://artificialguy.com">artificialguy.com</a></p>
|
100 |
"""
|
101 |
+
|
102 |
gr.Markdown(description)
|
|
|
103 |
chat_history_state = gr.State([])
|
104 |
|
105 |
chatbot = gr.ChatInterface(
|
106 |
fn=lambda message, history: update_chatbot(message, history, system_msg.value, max_tokens.value, temperature.value, top_p.value),
|
|
|
107 |
additional_inputs=[system_msg, max_tokens, temperature, top_p],
|
108 |
title="LLAMA 2 70B Chatbot",
|
109 |
submit_btn="Submit",
|
|
|
112 |
|
113 |
chatbot.clear(
|
114 |
fn=clear_chat,
|
115 |
+
inputs=[chat_history_state, chatbot.textbox],
|
116 |
+
outputs=[chat_history_state, chatbot.textbox]
|
117 |
)
|
118 |
|
119 |
demo.launch()
|