Spaces:
Sleeping
Sleeping
Commit
•
eb7cf96
1
Parent(s):
19e0fe7
Update app.py
Browse files
app.py
CHANGED
@@ -62,12 +62,11 @@ with gr.Blocks() as demo:
|
|
62 |
msg.submit(respond, inputs=[msg, chatbot], outputs=[msg, chatbot]) #Press enter to submit
|
63 |
gr.close_all()
|
64 |
|
65 |
-
context = '''
|
|
|
|
|
66 |
Kalasalingam Academy of Research and Education (KARE) (Deemed to be University) formerly Arulmigu Kalasalingam College of Engineering was established in 1984 by Kalvivallal Thiru T.Kalasalingam under the trust Kalasalingam and Anandam Ammal Charities, Founder Chairman who was a freedom fighter and Philanthropist. Kalasalingam is Located at the pristine foothills of scenic Western Ghats of southern Tamilnadu. The college obtained the Deemed to be University status in 2006. The Institution has been serving the society for thirty seven long years and it caters to the needs of the students from all walks of the society. Kalasalingam offers UG programmes, PG programmes and Ph.D programmes in various disciplines of Engineering, Science, Technology and Humanities. It is the first Institution in India to introduce a special B.Tech programme in engineering for the differently able (speech and hearing impaired) students. The Institution has been re-accredited by NAAC with ‘A++’ grade. Six UG programmes have been accredited by NBA under Tier-1. The Institution continues to do indefatigable work in getting projects and research centers. It has received DST funding to establish the National Center for Advance Research in Discrete Mathematics. KARE has got the state of the art IRC with splendid high end instruments for advanced research in material sciences and life sciences. Multistoried separate hostels with plenty of facilities provide accommodation to thousands of students. The institution has spent exorbitant sum to create a world class swimming pool and indoor auditorium for sports. Furthermore KARE gives utmost importance to Intra-mural and Extra mural activities for the holistic development of the students.
|
67 |
|
68 |
-
Location
|
69 |
-
Kalasalingam Academy of Research and Education is situated at Krishnankoil, 65 km (40 mi) south of Madurai and 10 km (6.2 mi) north of Srivilliputhur, in Madurai-Shenkottah National Highway (NH208). The location is at the foothills of the Western Ghats in a rural setting of Virudhunagar District.
|
70 |
-
|
71 |
VISION
|
72 |
To be a University of Excellence of International Repute in Education and Research.
|
73 |
|
@@ -282,8 +281,8 @@ def respond(message, chat_history, max_convo_length = 10):
|
|
282 |
formatted_prompt = format_chat_prompt(message, chat_history, max_convo_length)
|
283 |
print('Prompt + Context:')
|
284 |
print(formatted_prompt)
|
285 |
-
bot_message = chat(system_prompt = f'''You are a
|
286 |
-
Only answer based on the context. If unsure,
|
287 |
user_prompt = formatted_prompt)
|
288 |
chat_history.append((message, bot_message))
|
289 |
return "", chat_history
|
@@ -297,4 +296,5 @@ with gr.Blocks() as demo:
|
|
297 |
btn.click(respond, inputs=[msg, chatbot], outputs=[msg, chatbot])
|
298 |
msg.submit(respond, inputs=[msg, chatbot], outputs=[msg, chatbot]) #Press enter to submit
|
299 |
gr.close_all()
|
300 |
-
demo.launch(share=True)
|
|
|
|
62 |
msg.submit(respond, inputs=[msg, chatbot], outputs=[msg, chatbot]) #Press enter to submit
|
63 |
gr.close_all()
|
64 |
|
65 |
+
context = '''
|
66 |
+
https://kalasalingam.ac.in
|
67 |
+
Overview
|
68 |
Kalasalingam Academy of Research and Education (KARE) (Deemed to be University) formerly Arulmigu Kalasalingam College of Engineering was established in 1984 by Kalvivallal Thiru T.Kalasalingam under the trust Kalasalingam and Anandam Ammal Charities, Founder Chairman who was a freedom fighter and Philanthropist. Kalasalingam is Located at the pristine foothills of scenic Western Ghats of southern Tamilnadu. The college obtained the Deemed to be University status in 2006. The Institution has been serving the society for thirty seven long years and it caters to the needs of the students from all walks of the society. Kalasalingam offers UG programmes, PG programmes and Ph.D programmes in various disciplines of Engineering, Science, Technology and Humanities. It is the first Institution in India to introduce a special B.Tech programme in engineering for the differently able (speech and hearing impaired) students. The Institution has been re-accredited by NAAC with ‘A++’ grade. Six UG programmes have been accredited by NBA under Tier-1. The Institution continues to do indefatigable work in getting projects and research centers. It has received DST funding to establish the National Center for Advance Research in Discrete Mathematics. KARE has got the state of the art IRC with splendid high end instruments for advanced research in material sciences and life sciences. Multistoried separate hostels with plenty of facilities provide accommodation to thousands of students. The institution has spent exorbitant sum to create a world class swimming pool and indoor auditorium for sports. Furthermore KARE gives utmost importance to Intra-mural and Extra mural activities for the holistic development of the students.
|
69 |
|
|
|
|
|
|
|
70 |
VISION
|
71 |
To be a University of Excellence of International Repute in Education and Research.
|
72 |
|
|
|
281 |
formatted_prompt = format_chat_prompt(message, chat_history, max_convo_length)
|
282 |
print('Prompt + Context:')
|
283 |
print(formatted_prompt)
|
284 |
+
bot_message = chat(system_prompt = f'''You are a college assistance chatbot. Generate the output for only the Assistant.
|
285 |
+
Only answer based on the context. If unsure, refer https://kalasalingam.ac.in. Context: {context}"''',
|
286 |
user_prompt = formatted_prompt)
|
287 |
chat_history.append((message, bot_message))
|
288 |
return "", chat_history
|
|
|
296 |
btn.click(respond, inputs=[msg, chatbot], outputs=[msg, chatbot])
|
297 |
msg.submit(respond, inputs=[msg, chatbot], outputs=[msg, chatbot]) #Press enter to submit
|
298 |
gr.close_all()
|
299 |
+
demo.launch(share=True)
|
300 |
+
|