Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,49 +53,21 @@ def respond(
|
|
| 53 |
"""
|
| 54 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 55 |
"""
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
#
|
| 59 |
-
#
|
| 60 |
-
#
|
| 61 |
-
#
|
| 62 |
-
#
|
| 63 |
-
#
|
| 64 |
-
#
|
| 65 |
-
#
|
| 66 |
-
#
|
| 67 |
-
#
|
| 68 |
-
#
|
| 69 |
-
#
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
def default_message():
|
| 73 |
-
"""Function to return initial default message."""
|
| 74 |
-
return [("Hi there! I'm your Dietician Assistant, here to help with general advice "
|
| 75 |
-
"on diet, nutrition, and healthy eating habits. Let's explore your questions.", "")]
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
# Set up the Gradio ChatInterface with an initial default message
|
| 79 |
-
with gr.Blocks() as demo:
|
| 80 |
-
chatbot = gr.ChatInterface(
|
| 81 |
-
respond,
|
| 82 |
-
# additional_inputs=[
|
| 83 |
-
# gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
| 84 |
-
# gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 85 |
-
# gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 86 |
-
# gr.Slider(
|
| 87 |
-
# minimum=0.1,
|
| 88 |
-
# maximum=1.0,
|
| 89 |
-
# value=0.95,
|
| 90 |
-
# step=0.05,
|
| 91 |
-
# label="Top-p (nucleus sampling)",
|
| 92 |
-
# ),
|
| 93 |
-
# ],
|
| 94 |
-
)
|
| 95 |
-
|
| 96 |
-
# Display the default message on load
|
| 97 |
-
gr.State(default_message()) # Store initial chat history
|
| 98 |
-
chatbot.history = default_message() # Set the chat history to show the greeting
|
| 99 |
|
| 100 |
|
| 101 |
|
|
|
|
| 53 |
"""
|
| 54 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 55 |
"""
|
| 56 |
+
demo = gr.ChatInterface(
|
| 57 |
+
respond,
|
| 58 |
+
# additional_inputs=[
|
| 59 |
+
# gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
| 60 |
+
# gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 61 |
+
# gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 62 |
+
# gr.Slider(
|
| 63 |
+
# minimum=0.1,
|
| 64 |
+
# maximum=1.0,
|
| 65 |
+
# value=0.95,
|
| 66 |
+
# step=0.05,
|
| 67 |
+
# label="Top-p (nucleus sampling)",
|
| 68 |
+
# ),
|
| 69 |
+
# ],
|
| 70 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
|
| 73 |
|