import os import openai import json import re #API Keys os.environ['OPENAI_API_TOKEN'] = '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' openai.api_key = os.environ['OPENAI_API_TOKEN'] import os import io import IPython.display from PIL import Image import base64 import requests, json import gradio as gr requests.adapters.DEFAULT_TIMEOUT = 60 def chat(system_prompt, user_prompt, model = 'gpt-3.5-turbo', temperature = 0, verbose = False): ''' Normal call of OpenAI API ''' response = openai.ChatCompletion.create( temperature = temperature, model=model, messages=[ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt} ]) res = response['choices'][0]['message']['content'] if verbose: print('System prompt:', system_prompt) print('User prompt:', user_prompt) print('GPT response:', res) return res def format_chat_prompt(message, chat_history, max_convo_length): prompt = "" for turn in chat_history[-max_convo_length:]: user_message, bot_message = turn prompt = f"{prompt}\nUser: {user_message}\nAssistant: {bot_message}" prompt = f"{prompt}\nUser: {message}\nAssistant:" return prompt def respond(message, chat_history, max_convo_length = 10): formatted_prompt = format_chat_prompt(message, chat_history, max_convo_length) print('Prompt + Context:') print(formatted_prompt) bot_message = chat(system_prompt = 'You are a friendly chatbot. Generate the output for only the Assistant.', user_prompt = formatted_prompt) chat_history.append((message, bot_message)) return "", chat_history with gr.Blocks() as demo: chatbot = gr.Chatbot(height=300) #just to fit the notebook msg = gr.Textbox(label="Prompt") btn = gr.Button("Submit") clear = gr.ClearButton(components=[msg, chatbot], value="Clear console") btn.click(respond, inputs=[msg, chatbot], outputs=[msg, chatbot]) msg.submit(respond, inputs=[msg, chatbot], outputs=[msg, chatbot]) #Press enter to submit gr.close_all() context = ''' https://kalasalingam.ac.in Overview 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. VISION To be a University of Excellence of International Repute in Education and Research. MISSION 1. To provide a scholarly teaching-learning ambience which results in creating graduates equipped with skills and acumen to solve real-life problems. 2. To promote research and create knowledge for human welfare, rural and societal development. 3. To nurture entrepreneurial ambition, industrial and societal connect by creating an environment through which innovators and leaders emerge. We assess your academic history as well as your ambitions and interests outside of the classroom as part of our comprehensive, holistic admission process. We seek students who like being challenged and are dedicated to the Institute’s mission of “creating technically competent, socially motivated technocrats and administrators.” Programmes Offered: MBA MCA MSW M.SC MA-ENGLISH PHD-ENGINEERING PHD-ARCHITECTURE PHD-ARTS AND SCIENCE MBA - INSURANCE AND RISK MANAGMENT PHD MANAGEMENT STUDIES LLB B.TECH B.ARCH B.SC B.COM BBA BCA BA M.TECH M.ARCH B.TECH. ELIGIBILITY AND SELECTION Eligibility towards Engineering Admissiotns – Undergraduate A Pass in Higher Secondary(+2 / Intermediate) of State Board, CBSE, Matric and any other Board of Education recognized by State and Central Government with an aggregate of 50% and above in (Mathematics/Biology), Physics and Chemistry. Candidates appearing in MPC are eligible to apply for all the B.Tech. Engineering programmes. Candidates appearing in BPC are eligible to apply only for B.Tech. Bio-stream Engineering programmes (B.Tech Biotechnology, B.Tech Food Technology). Students holding High School Diploma issued by Northwest Accreditation Commission – US (NWAC-US) are eligible by providing an equivalent certificate issued by the association of Indian University (AIU) for B.Tech. courses. ‘NIOS’ candidates are eligible to apply. For Lateral Entry: Students with an average of 60% marks in pre-final and final semester put together in a three-year Diploma Courses in the relevant area are eligible to apply. B.Tech. Fee Structure Resident Indian Fee Structure (Fees Structure 2024-2025) Programme Tuition Fee One time Admission Fee Miscellaneous Fee(Annual) Application Cost B.Tech (CSE) and B.Tech (AI&DS) 1,85,000 10,000 12,000 Rs.600 B.Tech (IT) 1,75,000 10,000 12,000 Rs.600 B.Tech (ECE) 1,50,000 10,000 12,000 Rs.600 B.Tech (Biotech) 1,20,000 10,000 12,000 Rs.600 B.Tech (All other Disciplines) 1,00,000 10,000 12,000 Rs.600 B.Tech (CSE) Lateral Entry 1,85,000 10,000 12,000 Rs.600 B.Tech (IT) Lateral Entry 1,75,000 10,000 12,000 Rs.600 B.Tech (ECE) Lateral Entry 1,50,000 10,000 12,000 Rs.600 B.Tech (All other Disciplines) Lateral Entry 1,00,000 10,000 12,000 Rs.600 B.Tech. (CSE) – SHIP I – IV Years 60,000 NA 5000 600 SHIP NIOS Scheme 11th & 12th 40,000 NA 5000 600 placements overview The Office of Corporate Relations(OCR) plays a significant role in creating job opportunities for Under Graduates and Postgraduates passing out from our University, providing regular training in career guidance and technical skills and the interface between industries and institute. Vision – To Equip the students with relevant and conceptualized professional skills and guiding them towards a bright future and career all around the world with the values of – Sincerity, Hard Work and Justice. Mission – To achieve 100% placement for students through dedication, attitude and complete involvement by arranging and coordinating various programmes that aim at moulding the students to meet the industry expectations in career building and in turn bring laurels to the parent institution. Objective 1.Developing the students to meet the Industry’s recruitment process. 2.To motivate students to develop technical knowledge and soft skills in terms of career planning, goal setting. 3.Aiming to Place the maximum number of students through On-campus & off-campus interviews conducted by the top companies. By establishing contact with reputed firms and industries regularly, the number of students placed through the campus interview is also persistently high. Because of sustenance in quality of passing out students and academics, the number of industries visiting us, increasing every year. Our revolutionary alumni have set new standards in the corporate world through their meritorious contributions, and it is our firm conviction that we continue the legacy in the years to come. Dream Offers Kalasalingam Academy of Research and Education collaborated with numerous corporate giants from different field of industry. The primary goal of the university is to enhance and groom the students. In order to make sure that the students are able to grab the opportunity to work in their dream companies, the members of the Office of Corporate Relations are working really hard.The Office of Corporate Relations grooms and prepares the students by doing mock interviews, test, etc. The University has Collaborated with corporate giants like Larson & Toubro, IBM, HCL, L&P, and so on. A significant number of the students in the final year are undergoing internship with various industries across India, in some cases internship offers are turned to placement and in some cases students get placement with internship opportunity. Various departments of the university has collaborated with many organization giants such as: Larson & Toubro, IBM, DELL, L&P, etc. Statistics KARE has continued to be the desired hiring choice for National and International organizations ranging from Multi-Disciplinary Employers, Consulting companies, Engineering and Manufacturing companies, Startups, Think Tanks and Financial institutions. Our Learning and Development programs empower the students to gain critical soft skills. 50LPA Highest CTC (nutanix) 4.5LPA Average CTC 800+ Recruiters Placement Highlights 1650+ Placement Offers 50LPA Maximum Package (nutanix) 150+ Companies 4.5LPA Average Package 250+ Internship Offers Career Guidence The OCR inculcates in career guidance programmes for all the students right from the first year. The OCR organizes Mock Interviews, Group Discussions, and Communication Skills Workshops etc. The OCR also invites HR Managers from various industries to conduct training programmes for final year students. The OCR is committed to the professional progress of KARE students through integrating the career issues within an academic environment for realizing their best possible career path. contact details Dr. A Alavudeen Director-corporate Relations Kalasalingam Academy of Research and Education Anand Nagar, Krishnankovil-626126 placements@klu.ac.in Mobile: +91-9443389276 Dr S P Velmurugan University Placement Coordinator Kalasalingam Academy of Research and Education Anand Nagar, Krishnankovil-626126 placements@klu.ac.in Mobile: +91-9488335060 campus life overview Welcome to the eco-friendly and integrated green campus located on the panoramic foothills of the Southern part of Western Ghats of Tamilnadu. The University houses in itself all that is essential for moulding the young children entrusted to her care into technically and ethically sound nation builders. It is a lovely sight to see the visitors from the Western Ghats—visitors like the Peacocks, the Peahens, batches of Deer, Bison, Wild Boars, Hedgehogs, to name a few. The presence of a sizable number of International communities on campus helps prevail a multicultural atmosphere. Campus Life It’s a Home away Home feel in Kalasalingam, provides essential opportunities for personal growth, development, education, meeting new people and managing your own time, prepare for life on campus by figuring out what to bring, how to handle challenging circumstances and what you can do to manage your workload. Residential Life of the campus has seven Multi storey Hostels separate for men and women, Guest House and Staff Quarters. Separate gym facilities, indoor sports units, swimming pool, essential stores, beauty parlour, salon, tailoring shops, HSE compliant Kitchen facility, housekeeping services, laundry services, Health Services and many more adds eminence to the residential life. The integrated technology innovation canter allows the innovators and entrepreneurs to grow their ideas to products with individual unit space and funding from national and international agencies. Green Campus Green campus with 163 Acres, 23 lacs Sq.Ft buildings and 11 lacs sq.ft of greeneries under the foot hill of southern western ghats.‘Cleanliness’ as per the Cambridge dictionary means the state of being clean or the act of keeping things clean. One of the first commandments for health is cleanliness. Cleanliness is essential physically, mentally, spiritually and even environmentally. In order to make the campus clean and Green, several initiatives are taken to deploy the same. Events @ kalasalingam SPARKZ 2020 Kalasalingam Academy of Research and Events hosted an extravaganza event named ‘SPARKZ’. The students of the university participated in various categories. This event is mainly a cultural event. One of the Chief guest in the event was Siddharth (from the movie Rang De Basanti) and many more famous celebrities took part in the event as the chief guests. In short,it proved to be an amazing event. Clubs and Forums No matter what your interest is, Kalasalingam provides you a platform of different clubs to match your interest and grow your dreams. Kalasalingam Clubs are a gateway to explore your interest and contribute to your intellectual and social life. As a club member one knows about one’s self, one’s interests, and one’s goals. Students can unravel their strengths like multitasking, organization skills, team-building skills, leadership skills, and service-mindedness. They can also add skills to their repertoire. The clubs also help in pursuing an old hobby. Labs Laboratories play a pivotal role at Kalasalingam Academy of Research and Education. Being a renowned institute in the domain of Engineering and Science, students of the university tends to incline towards research and experiments. Having specific laboratories for science and engineering students played a really important role in their development. Kalasalingam Academy of Research and Education as a university became the first one to have specialized laboratories for speech and hearing-impaired students. The university has labs such as audio speech labs, audiology labs, computer labs, etc. in order to make them capable to face the outside world. Computer Labs KARE has more than 50 Computer labs with 2500+ computers across different departments. An exclusive common computing facility is also available for students and faculty. A 3 GBPS internet connection is available connecting all computers providing internet access to all Systems. Audiology Laboratory KARE has Speech and Audiology lab to monitor and enhance the speech and hearing levels of these students. Audiology labs serve as a practical center for analyzing the various aspects of sound creation. Here, the systematic conversion of sound perception takes place sensibly and effectively. BOSH Laboratory KARE jointly with BOSH has setup laboratory for providing training in evolving technologies and at the same time provide hands-on experience with the latest equipment. This will provide training in the areas of diesel systems, gasoline systems, diagnostics and auto electrical among other areas. Hostel and Mess One of the key contributors to an intensive learning experience is living in campus. Kalasalingam Academy of Research and Education (KARE) has a residential facility on campus for the students. A well-furnished and artistically designed hostels with separate buildings for boys and girls has been constructed with a view to provide best possible facilities to the students. All the Hostels are located inside the same campus and are under the surveillance of CCTV camera and provides safe environment for both boys and girls. Transport The Institution has a fleet of 40 buses and two vans to transport students and staff members. The bus terminus include Krishnankoil, Srivilliputtur, Rajapalayam, Sivakasi, Madurai, Watrap, and Institution campus. Besides the regular scheduled trips, the facility is extended for occasions like after the college hour Special Coaching Classes, Visit to Local Industries, hospitals, NSS Camps, etc. Library The Central Library was started along with the institution in the year 1984. It is a two storied building built on a built-up area of more than one lakh square feet and fully air-conditioned with the seating capacity to accommodate more than 1000 users at a time. It has more than 98,000 volumes of books in various domains such as engineering, management, advanced sciences, life sciences and agriculture and general. The library subscribes to 412 periodicals in print at national and international level. Besides, the library has 3383 bound volumes of periodicals, 5708 Project Reports. StartUps & Incubations The Kalasalingam Technology Business Incubator (KTBI) was established in the year 2015, which was started as Innovation and Entrepreneurship Development Centre (IEDC) with the support of NSTEDB National Science and Technology Entrepreneurship Development Board (NSTEDB), Department of Science and Technology (DST), New Delhi. Students and faculty are motivated to convert their innovative ideas to product with the support of upto ₹10 Lacs from KTBI under IEDC scheme, which strengthens the entrepreneurial ecosystem. Student Affairs Our students have developed software that helps in the learning process of hearing-impaired people. Our students have also developed software for Exam Administration System (EASY), Attendance Information Systems (AIMS), Student Information System (SIS), Staff Attendance and Leave Transaction (SALT), Students SMS (S-SMS), Online Registration System (OCRS) Hostel Management System, Finance Management System, Health Center Management and Biometric Based Attendance Monitoring System for staff. These softwares are currently used in our University. Moreover, our students have also developed school automation software as per the needs of schools. Competitions Students are motivated to participate in department association activities like quizzes, paper presentations, etc. Moreover, they are allowed to participate in inter and intra collegiate to equip them with today’s competitive world. “Kalvivallal” Thiru T. Kalasalingam Founder Chairman Chairman’s Message A warm welcome to Kalasalingam Academy of Research and Education. This is the right spot for you to get trained in your chosen field of study. You have almost all pro-grammes under the sun, except of course, Medicine. Back in the 1980’s the Institute was instituted by a divine dispensation. It was rather mysterious to me; to set up a Centre for higher learning in a backward village was strange then. But now it is very clear to me; the Institute is set up here to help improve the plight of the children of the local farmers and artisans, who have no access to higher education, especially Engineering. I am very passionate about this Institute. As I too hail from this locality, I know the difficulties of the local people; over the years, hundreds and thousands of children from the huts of these poverty-stricken, families devoid of any kind of facility, have got specialized education and they have been profitably employed. Thereby the fortunes of these families have been remarkably upgraded. Now the Institution attracts children from all over the world who wish to get high quality education at affordable fees. The campus is a melting pot of thousands of Indian and overseas children. The pluralistic character witnessed on all front is the hall mark of our Institute. I wish to affirm that the Institute is not set up for a profit motive; whatever is collected is plowed back into the premises to upgrade equipment and the other infrastructure facilities. Children who opt for this campus are treated with brotherly/sisterly kindness. They enjoy diversity and richness, besides time-tested values and emerging ideas. They find the faculty highly qualified, but at the same time down to earth. As the world changes so fast over the past three decades, we also grapple with curriculum, syllabus and structural changes. There is tons of evidence to show that all our children are placed with high lucrative job offers. “Illayavallal” Dr. K. Sridharan Chancellor A warm welcome to Kalasalingam Academy of Research and Education. Even though the Institution is built in a village, on campus a multicultural atmosphere prevails. Students speaking different languages, professing differing worship patterns, following diverse cultural practices—all make the campus a truly multinational one. You have a whopping list of programmes tailor-made for you. This includes Engineering, Architecture, Arts, Sciences, Business Management and Commerce. These programmes are offered at the Undergraduate and Postgraduate levels. It is not at all an exaggeration to say that our forte is research. We have an exclusive Centre for Research, which we call International Research Centre; it is equipped with sophisticated machinery and material. Hundreds of full time scholars are actively involved in research; I wish to humbly state that only a committed institution can offer such a facility. We are particular that the research findings are passed on to the nearby industries and academia. We trust that all your career dreams and aspirations will be fulfilled here. We have an accomplished line of faculty well-trained in their areas and also imbibed with teaching skills. Each of our hostels is a home away from home. Dr. S Narayanan Vice-Chancellor A warm welcome to Kalasalingam Academy of Research and Education (KARE). It is both a pleasure and pride to be a part of KARE, which is an institution possessing unique capabilities and ranked high by NIRF, of the Ministry of MHRD, Govt. of India. You will be pleased to note that the KARE has a commanding position under THE subject ranking. There are many more feathers to the cap of the KARE which is not an easy task to accomplish. With an updated and upgraded futuristic curriculum, I am sure we will enrich the teaching- learning experience of the students at the institute. Necessary steps are taken to impart industry-oriented knowledge to our students and stride the path to produce candidates who will be industry ready. We are also focusing on creating an enabling environment to realize the enormous latent talents of our students to contribute to the well-being of the society through research and innovation and inculcate an entrepreneurial spirit. A special focus would be on contributing to the upliftment of the children of the local farmers and artisans, who have limited access to higher education, as envisioned by our Founder Chairman. In a nutshell, we are concentrating on establishing an active system to propel the institute to greater heights, where we would help our students to generate ideas that will be beneficial to the society through education and training that will be valued for their knowledge which will help solve social problems and aid in societal development. Rankings College rankings Engineering – India NIRF (2022)[4] 39 Kalasalingam Academy of Research and Education was ranked 39 among engineering colleges by the National Institutional Ranking Framework (NIRF) in 2022.[4] ''' def format_chat_prompt(message, chat_history, max_convo_length): prompt = "" for turn in chat_history[-max_convo_length:]: user_message, bot_message = turn prompt = f"{prompt}\nUser: {user_message}\nAssistant: {bot_message}" prompt = f"{prompt}\nUser: {message}\nAssistant:" return prompt def respond(message, chat_history, max_convo_length = 10): formatted_prompt = format_chat_prompt(message, chat_history, max_convo_length) print('Prompt + Context:') print(formatted_prompt) bot_message = chat(system_prompt = f'''You are a college assistance chatbot. Generate the output for only the Assistant. Only answer based on the context. If unsure, refer https://kalasalingam.ac.in. Context: {context}"''', user_prompt = formatted_prompt) chat_history.append((message, bot_message)) return "", chat_history with gr.Blocks() as demo: chatbot = gr.Chatbot(height=300) #just to fit the notebook msg = gr.Textbox(label="Prompt") btn = gr.Button("Submit") clear = gr.ClearButton(components=[msg, chatbot], value="Clear console") btn.click(respond, inputs=[msg, chatbot], outputs=[msg, chatbot]) msg.submit(respond, inputs=[msg, chatbot], outputs=[msg, chatbot]) #Press enter to submit gr.close_all() demo.launch(share=True)