Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,3 +87,88 @@ with gr.ChatInterface(
|
|
| 87 |
demo.load(__attachIp, None, None)
|
| 88 |
|
| 89 |
demo.launch(debug=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
demo.load(__attachIp, None, None)
|
| 88 |
|
| 89 |
demo.launch(debug=True)
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
# Your custom CSS code
|
| 93 |
+
css = """
|
| 94 |
+
/* Container styles */
|
| 95 |
+
.container {
|
| 96 |
+
background-color: #f7f7f7;
|
| 97 |
+
padding: 20px;
|
| 98 |
+
border-radius: 12px;
|
| 99 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
/* Header styles */
|
| 103 |
+
#header {
|
| 104 |
+
font-family: 'Helvetica Neue', sans-serif;
|
| 105 |
+
font-weight: 700;
|
| 106 |
+
font-size: 24px;
|
| 107 |
+
color: #333;
|
| 108 |
+
margin-bottom: 20px;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
/* Input box styles */
|
| 112 |
+
#input-text {
|
| 113 |
+
background-color: #ffffff;
|
| 114 |
+
border: 1px solid #dddddd;
|
| 115 |
+
border-radius: 8px;
|
| 116 |
+
padding: 10px;
|
| 117 |
+
font-size: 16px;
|
| 118 |
+
color: #333333;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/* Output box styles */
|
| 122 |
+
#output-text {
|
| 123 |
+
background-color: #ffffff;
|
| 124 |
+
border: 1px solid #dddddd;
|
| 125 |
+
border-radius: 8px;
|
| 126 |
+
padding: 10px;
|
| 127 |
+
font-size: 16px;
|
| 128 |
+
color: #333333;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
/* Button styles */
|
| 132 |
+
.submit {
|
| 133 |
+
background-color: #ff7f50;
|
| 134 |
+
color: white;
|
| 135 |
+
border-radius: 8px;
|
| 136 |
+
padding: 10px 20px;
|
| 137 |
+
border: none;
|
| 138 |
+
cursor: pointer;
|
| 139 |
+
font-size: 16px;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
.submit:hover {
|
| 143 |
+
background-color: #ff6347;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
/* Additional styling for retry, undo, clear buttons */
|
| 147 |
+
.retry, .undo, .clear {
|
| 148 |
+
background-color: #dddddd;
|
| 149 |
+
border: none;
|
| 150 |
+
border-radius: 8px;
|
| 151 |
+
padding: 8px 16px;
|
| 152 |
+
color: #333333;
|
| 153 |
+
cursor: pointer;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
.retry:hover, .undo:hover, .clear:hover {
|
| 157 |
+
background-color: #cccccc;
|
| 158 |
+
}
|
| 159 |
+
"""
|
| 160 |
+
|
| 161 |
+
def chatbot(message):
|
| 162 |
+
response = "Hey, I am Jeff Bezos, Founder of Amazon"
|
| 163 |
+
return response
|
| 164 |
+
|
| 165 |
+
# Creating the Gradio interface with the custom CSS
|
| 166 |
+
with gr.Blocks(css=css) as demo:
|
| 167 |
+
gr.Markdown("# Business Advice from Jeff Bezos", elem_id="header")
|
| 168 |
+
input_box = gr.Textbox(label="Your Question", elem_id="input-text")
|
| 169 |
+
output_box = gr.Textbox(label="Business Advice from Jeff Bezos", elem_id="output-text")
|
| 170 |
+
submit_btn = gr.Button("Submit", elem_id="submit")
|
| 171 |
+
|
| 172 |
+
submit_btn.click(chatbot, inputs=input_box, outputs=output_box)
|
| 173 |
+
|
| 174 |
+
demo.launch()
|