Update app.py
Browse files
app.py
CHANGED
|
@@ -33,51 +33,22 @@ def lechat_respond(
|
|
| 33 |
yield response
|
| 34 |
|
| 35 |
|
| 36 |
-
# #chat interface for le_chat
|
| 37 |
-
# mistral_chat = gr.ChatInterface(
|
| 38 |
-
# fn = lechat_respond,
|
| 39 |
-
# type = 'messages',
|
| 40 |
-
# chatbot = gr.Chatbot(placeholder = "<h5>LLM running on cpu so it may take long time to respond to ur prompt !</h5>"),
|
| 41 |
-
# textbox = gr.Textbox(placeholder= "Ask whatever", scale = 7, container = False),
|
| 42 |
-
# additional_inputs=[
|
| 43 |
-
# gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 44 |
-
# gr.Slider(minimum=0.1, maximum=4.0, value=0.8, step=0.1, label="Temperature"),
|
| 45 |
-
# gr.Slider(minimum=0.1,maximum=1.0,value=0.95,step=0.05,label="Top-p (nucleus sampling)"),
|
| 46 |
-
# gr.Slider(minimum = 40, maximum = 10000, value = 40, step = 10, label = "Top-k"),
|
| 47 |
-
# ],
|
| 48 |
-
# theme= "ocean",
|
| 49 |
-
# examples= [["Write a haiku about destruction of human's and the raise of AI"], ["Which species will rule the Earth in the future"]],
|
| 50 |
-
# cache_examples = True
|
| 51 |
-
# )
|
| 52 |
-
|
| 53 |
#chat interface for le_chat
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
["Write a haiku about the destruction of humans and the rise of AI"],
|
| 70 |
-
["Which species will rule the Earth in the future?"]
|
| 71 |
-
],
|
| 72 |
-
inputs=[txt]
|
| 73 |
-
)
|
| 74 |
-
|
| 75 |
-
send.click(
|
| 76 |
-
fn = lechat_respond,
|
| 77 |
-
inputs = [txt, chatbot, max_tokens, temperature, top_p, top_k],
|
| 78 |
-
outputs = chatbot,
|
| 79 |
-
queue = True
|
| 80 |
-
)
|
| 81 |
|
| 82 |
if __name__ == "__main__":
|
| 83 |
mistral_chat.launch()
|
|
|
|
| 33 |
yield response
|
| 34 |
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
#chat interface for le_chat
|
| 37 |
+
mistral_chat = gr.ChatInterface(
|
| 38 |
+
fn = lechat_respond,
|
| 39 |
+
type = 'messages',
|
| 40 |
+
# chatbot = gr.Chatbot(placeholder = "<h5>LLM running on cpu so it may take long time to respond to ur prompt !</h5>"),
|
| 41 |
+
# textbox = gr.Textbox(placeholder= "Ask whatever", scale = 7, container = False),
|
| 42 |
+
additional_inputs=[
|
| 43 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 44 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.8, step=0.1, label="Temperature"),
|
| 45 |
+
gr.Slider(minimum=0.1,maximum=1.0,value=0.95,step=0.05,label="Top-p (nucleus sampling)"),
|
| 46 |
+
gr.Slider(minimum = 40, maximum = 10000, value = 40, step = 10, label = "Top-k"),
|
| 47 |
+
],
|
| 48 |
+
# theme= "ocean",
|
| 49 |
+
# examples= [["Write a haiku about destruction of human's and the raise of AI"], ["Which species will rule the Earth in the future"]],
|
| 50 |
+
# cache_examples = True
|
| 51 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
if __name__ == "__main__":
|
| 54 |
mistral_chat.launch()
|