Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,6 +33,11 @@ def get_predefined_questions():
|
|
| 33 |
"What are the key highlights of the Master of Engineering Handbook?",
|
| 34 |
"How to start a career in AI?",
|
| 35 |
"When will the CPT start date?",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
]
|
| 37 |
|
| 38 |
# Function to Process Query
|
|
@@ -42,7 +47,12 @@ def process_query(question):
|
|
| 42 |
"What is the scope of AI in engineering?": "AI in engineering includes predictive maintenance, process optimization, and smart systems.",
|
| 43 |
"What are the key highlights of the Master of Engineering Handbook?": "The handbook highlights program structure, course requirements, and career support for MEng students.",
|
| 44 |
"How to start a career in AI?": "Starting a career in AI involves learning programming, data science, and machine learning frameworks.",
|
| 45 |
-
"When will the CPT start date?": "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
}
|
| 47 |
|
| 48 |
if question in predefined_responses:
|
|
@@ -59,13 +69,18 @@ def chatbot_ui(question):
|
|
| 59 |
def main():
|
| 60 |
predefined_questions = get_predefined_questions()
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
demo.launch()
|
| 71 |
|
|
|
|
| 33 |
"What are the key highlights of the Master of Engineering Handbook?",
|
| 34 |
"How to start a career in AI?",
|
| 35 |
"When will the CPT start date?",
|
| 36 |
+
"What are the ethical considerations in AI development?",
|
| 37 |
+
"What are the differences between supervised and unsupervised learning?",
|
| 38 |
+
"What are the benefits of enrolling in an MEng program?",
|
| 39 |
+
"What is the importance of Generative AI in modern technology?",
|
| 40 |
+
"What is the process to apply for internships as an MEng student?"
|
| 41 |
]
|
| 42 |
|
| 43 |
# Function to Process Query
|
|
|
|
| 47 |
"What is the scope of AI in engineering?": "AI in engineering includes predictive maintenance, process optimization, and smart systems.",
|
| 48 |
"What are the key highlights of the Master of Engineering Handbook?": "The handbook highlights program structure, course requirements, and career support for MEng students.",
|
| 49 |
"How to start a career in AI?": "Starting a career in AI involves learning programming, data science, and machine learning frameworks.",
|
| 50 |
+
"When will the CPT start date?": "CPT start dates vary by university. Generally, it starts after completing two semesters, depending on the program's policies.",
|
| 51 |
+
"What are the ethical considerations in AI development?": "Ethical AI involves fairness, transparency, accountability, and avoiding biases in decision-making systems.",
|
| 52 |
+
"What are the differences between supervised and unsupervised learning?": "Supervised learning uses labeled data for training, while unsupervised learning identifies patterns in unlabeled data.",
|
| 53 |
+
"What are the benefits of enrolling in an MEng program?": "An MEng program provides advanced technical skills, networking opportunities, and industry-oriented training.",
|
| 54 |
+
"What is the importance of Generative AI in modern technology?": "Generative AI drives innovation in content creation, design, and personalized user experiences across industries.",
|
| 55 |
+
"What is the process to apply for internships as an MEng student?": "Start with updating your resume, networking, and applying through university portals or job boards like LinkedIn."
|
| 56 |
}
|
| 57 |
|
| 58 |
if question in predefined_responses:
|
|
|
|
| 69 |
def main():
|
| 70 |
predefined_questions = get_predefined_questions()
|
| 71 |
|
| 72 |
+
with gr.Blocks() as demo:
|
| 73 |
+
gr.Markdown("## Azure-Powered RAG Chatbot")
|
| 74 |
+
|
| 75 |
+
question_input = gr.Dropdown(choices=predefined_questions, label="Select a predefined question")
|
| 76 |
+
response_output = gr.Textbox(label="Chatbot Response")
|
| 77 |
+
|
| 78 |
+
with gr.Row():
|
| 79 |
+
submit_btn = gr.Button("Submit")
|
| 80 |
+
clear_btn = gr.Button("Clear")
|
| 81 |
+
|
| 82 |
+
submit_btn.click(chatbot_ui, inputs=question_input, outputs=response_output)
|
| 83 |
+
clear_btn.click(lambda: "", inputs=None, outputs=response_output)
|
| 84 |
|
| 85 |
demo.launch()
|
| 86 |
|