Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -154,56 +154,36 @@ LinkedIn:
|
|
| 154 |
me = Me()
|
| 155 |
|
| 156 |
with gr.Blocks(css="""
|
| 157 |
-
body, .gradio-container {
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
}
|
| 161 |
-
.gr-button {
|
| 162 |
-
background-color: #ff4da6 !important;
|
| 163 |
-
color: black !important;
|
| 164 |
-
border-radius: 6px !important;
|
| 165 |
-
font-weight: 600 !important;
|
| 166 |
-
}
|
| 167 |
-
.gr-button:hover {
|
| 168 |
-
background-color: #ff1a8c !important;
|
| 169 |
-
}
|
| 170 |
-
.gr-chatbox, .gr-chat-interface {
|
| 171 |
-
background-color: #1a1a1a !important;
|
| 172 |
-
border: 1px solid #ff4da6 !important;
|
| 173 |
-
}
|
| 174 |
""") as ui:
|
| 175 |
|
| 176 |
-
gr.Markdown("### Quick Options"
|
| 177 |
-
|
| 178 |
-
with gr.Row():
|
| 179 |
-
btn_contact = gr.Button("Contact Info")
|
| 180 |
-
btn_about = gr.Button("Who is Ayush?")
|
| 181 |
-
btn_projects = gr.Button("Latest Projects")
|
| 182 |
|
|
|
|
| 183 |
chat = gr.ChatInterface(
|
| 184 |
fn=me.chat,
|
| 185 |
title="Ayush Tyagi — Personal Assistant",
|
| 186 |
-
type="messages"
|
| 187 |
)
|
| 188 |
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
)
|
| 194 |
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
inputs=chat.chatbot,
|
| 198 |
-
outputs=chat.chatbot
|
| 199 |
)
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
)
|
| 206 |
|
| 207 |
if __name__ == "__main__":
|
| 208 |
ui.launch(server_name="0.0.0.0", server_port=int(os.environ.get("PORT", 7860)))
|
| 209 |
|
|
|
|
|
|
| 154 |
me = Me()
|
| 155 |
|
| 156 |
with gr.Blocks(css="""
|
| 157 |
+
body, .gradio-container { background-color: #0d0d0d; color: white; }
|
| 158 |
+
.gr-button { background-color: #ff4da6 !important; color: black !important; border-radius: 6px !important; font-weight: 600 !important; }
|
| 159 |
+
.gr-button:hover { background-color: #ff1a8c !important; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
""") as ui:
|
| 161 |
|
| 162 |
+
gr.Markdown("### Quick Options")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
+
user_input = gr.Textbox(visible=False)
|
| 165 |
chat = gr.ChatInterface(
|
| 166 |
fn=me.chat,
|
| 167 |
title="Ayush Tyagi — Personal Assistant",
|
| 168 |
+
type="messages"
|
| 169 |
)
|
| 170 |
|
| 171 |
+
with gr.Row():
|
| 172 |
+
btn_contact = gr.Button("Contact Info")
|
| 173 |
+
btn_about = gr.Button("Who is Ayush?")
|
| 174 |
+
btn_projects = gr.Button("Latest Projects")
|
|
|
|
| 175 |
|
| 176 |
+
btn_contact.click(lambda: "What is Ayush Tyagi's contact information?", None, user_input).then(
|
| 177 |
+
chat.submit, [user_input], chat.chatbot
|
|
|
|
|
|
|
| 178 |
)
|
| 179 |
+
btn_about.click(lambda: "Who is Ayush Tyagi?", None, user_input).then(
|
| 180 |
+
chat.submit, [user_input], chat.chatbot
|
| 181 |
+
)
|
| 182 |
+
btn_projects.click(lambda: "Show Ayush Tyagi’s latest projects.", None, user_input).then(
|
| 183 |
+
chat.submit, [user_input], chat.chatbot
|
| 184 |
)
|
| 185 |
|
| 186 |
if __name__ == "__main__":
|
| 187 |
ui.launch(server_name="0.0.0.0", server_port=int(os.environ.get("PORT", 7860)))
|
| 188 |
|
| 189 |
+
|