Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import torch
|
2 |
-
from
|
3 |
from langchain.chains import LLMChain
|
4 |
from langchain import PromptTemplate
|
5 |
import gradio as gr
|
@@ -51,9 +51,19 @@ def bot(query):
|
|
51 |
return llm_response
|
52 |
|
53 |
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
58 |
|
59 |
-
|
|
|
|
|
|
1 |
import torch
|
2 |
+
from langchain.llms import CTransformers
|
3 |
from langchain.chains import LLMChain
|
4 |
from langchain import PromptTemplate
|
5 |
import gradio as gr
|
|
|
51 |
return llm_response
|
52 |
|
53 |
|
54 |
+
with gr.Blocks(title='Sunny', css="footer {visibility: hidden}") as main:
|
55 |
+
gr.Markdown("# Sunny Chatbot")
|
56 |
+
chatbot = gr.Chatbot([], elem_id="chatbot", height=700)
|
57 |
+
msg = gr.Textbox()
|
58 |
+
clear = gr.ClearButton([msg, chatbot])
|
59 |
+
css="footer {visibility: hidden}"
|
60 |
|
61 |
+
def respond(message, chat_history):
|
62 |
+
bot_message = bot(message)
|
63 |
+
chat_history.append((message, bot_message))
|
64 |
+
time.sleep(2)
|
65 |
+
return "", chat_history
|
66 |
|
67 |
+
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
68 |
+
|
69 |
+
main.launch(share=False)
|