Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -73,29 +73,8 @@ if cfg.examples:
|
|
73 |
else:
|
74 |
app_examples = None
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
def append_example(example, history):
|
79 |
-
initial_message = [None, "How may I help you?"]
|
80 |
-
if not history:
|
81 |
-
history = [initial_message]
|
82 |
-
history.append([example, None])
|
83 |
-
return "", history
|
84 |
-
|
85 |
-
# Create the Gradio Blocks interface
|
86 |
-
with gr.Blocks() as demo:
|
87 |
-
chatbot = gr.Chatbot(value=[[None, "How may I help you?"]])
|
88 |
-
examples = gr.Examples(examples=[[example] for example in app_examples], inputs=None, outputs=chatbot, fn=append_example)
|
89 |
-
|
90 |
-
gr.ChatInterface(
|
91 |
-
fn = respond,
|
92 |
-
description = cfg.description,
|
93 |
-
css = css,
|
94 |
-
chatbot = chatbot
|
95 |
-
)
|
96 |
-
|
97 |
-
# demo = gr.ChatInterface(respond, description = cfg.description, css = css,
|
98 |
-
# chatbot = gr.Chatbot(value = [[None, "How may I help you?"]]), examples = app_examples)
|
99 |
|
100 |
|
101 |
if __name__ == "__main__":
|
|
|
73 |
else:
|
74 |
app_examples = None
|
75 |
|
76 |
+
demo = gr.ChatInterface(respond, description = cfg.description, css = css,
|
77 |
+
chatbot = gr.Chatbot(value = [[None, "How may I help you?"]]), examples = app_examples)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
|
80 |
if __name__ == "__main__":
|