Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,9 +74,11 @@ class Me:
|
|
| 74 |
self.summary = ""
|
| 75 |
self.linkedin = ""
|
| 76 |
|
|
|
|
| 77 |
if os.path.exists("me/summary.txt"):
|
| 78 |
self.summary = open("me/summary.txt", "r", encoding="utf-8").read()
|
| 79 |
|
|
|
|
| 80 |
pdf_path = "me/Ayush_linkdin.pdf"
|
| 81 |
if os.path.exists(pdf_path):
|
| 82 |
text = []
|
|
@@ -167,13 +169,13 @@ with gr.Blocks(css="""
|
|
| 167 |
|
| 168 |
/* Chatbot background image */
|
| 169 |
#chatbot {
|
| 170 |
-
background: url('
|
| 171 |
background-size: cover;
|
| 172 |
border-radius: 12px;
|
| 173 |
padding: 10px;
|
| 174 |
}
|
| 175 |
|
| 176 |
-
/* Mobile scaling */
|
| 177 |
@media (max-width: 600px) {
|
| 178 |
#chatbot {
|
| 179 |
background-size: contain;
|
|
@@ -185,9 +187,9 @@ with gr.Blocks(css="""
|
|
| 185 |
chatbot = gr.Chatbot(type="messages", height=420, elem_id="chatbot")
|
| 186 |
|
| 187 |
with gr.Row():
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
|
| 192 |
with gr.Row():
|
| 193 |
user_input = gr.Textbox(
|
|
@@ -199,10 +201,6 @@ with gr.Blocks(css="""
|
|
| 199 |
user_input.submit(respond, [user_input, chatbot], [user_input, chatbot])
|
| 200 |
send_btn.click(respond, [user_input, chatbot], [user_input, chatbot])
|
| 201 |
|
| 202 |
-
btn_about.click(lambda: "Who are you?", None, user_input)
|
| 203 |
-
btn_contact.click(lambda: "What is Ayush Tyagi's contact information?", None, user_input)
|
| 204 |
-
btn_projects.click(lambda: "Show Ayush Tyagi’s latest projects.", None, user_input)
|
| 205 |
-
|
| 206 |
|
| 207 |
if __name__ == "__main__":
|
| 208 |
ui.launch()
|
|
|
|
| 74 |
self.summary = ""
|
| 75 |
self.linkedin = ""
|
| 76 |
|
| 77 |
+
# Load summary
|
| 78 |
if os.path.exists("me/summary.txt"):
|
| 79 |
self.summary = open("me/summary.txt", "r", encoding="utf-8").read()
|
| 80 |
|
| 81 |
+
# Load LinkedIn PDF text
|
| 82 |
pdf_path = "me/Ayush_linkdin.pdf"
|
| 83 |
if os.path.exists(pdf_path):
|
| 84 |
text = []
|
|
|
|
| 169 |
|
| 170 |
/* Chatbot background image */
|
| 171 |
#chatbot {
|
| 172 |
+
background: url('bg_desktop.jpg') no-repeat center;
|
| 173 |
background-size: cover;
|
| 174 |
border-radius: 12px;
|
| 175 |
padding: 10px;
|
| 176 |
}
|
| 177 |
|
| 178 |
+
/* Mobile-friendly scaling */
|
| 179 |
@media (max-width: 600px) {
|
| 180 |
#chatbot {
|
| 181 |
background-size: contain;
|
|
|
|
| 187 |
chatbot = gr.Chatbot(type="messages", height=420, elem_id="chatbot")
|
| 188 |
|
| 189 |
with gr.Row():
|
| 190 |
+
gr.Button("Who are you?").click(lambda: "Who are you?", None, "user_input")
|
| 191 |
+
gr.Button("Contact Info").click(lambda: "What is Ayush Tyagi's contact information?", None, "user_input")
|
| 192 |
+
gr.Button("Latest Projects").click(lambda: "Show Ayush Tyagi’s latest projects.", None, "user_input")
|
| 193 |
|
| 194 |
with gr.Row():
|
| 195 |
user_input = gr.Textbox(
|
|
|
|
| 201 |
user_input.submit(respond, [user_input, chatbot], [user_input, chatbot])
|
| 202 |
send_btn.click(respond, [user_input, chatbot], [user_input, chatbot])
|
| 203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
|
| 205 |
if __name__ == "__main__":
|
| 206 |
ui.launch()
|