Walterchamy commited on
Commit
aac4aed
1 Parent(s): 88e1731

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +113 -0
app.py ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import openai
3
+ from gtts import gTTS
4
+ import streamlit as st
5
+ openai.api_key = os.getenv("OPENAI_API_KEY")
6
+
7
+ KIITEC_CONTENT = """
8
+
9
+ KIITEC is a technical institution registered by NACTE (REG/EOS/027) based in Moshono, Arusha next to Masai Camp.
10
+
11
+ The institute was founded in 2004 by French engineers and has thence contrived to produce the most competent technicians in the country. The institute is financed and supported by two NGOs: The Foundation for Technical Education (FTE-Swiss) and Action Development Education International (ADEI-French). In 2004, ADEI's partner FTE built the Kilimanjaro International Institute of Telecommunications, Electronics and Computers (KIITEC) introducing state-of-the-art teaching facilities to train technicians in Arusha, Tanzania.
12
+
13
+ Following construction, ADEI joined FTE in its ambition to make change through technical education and has played a pivotal role in the on-the-ground education programming and training at KIITEC ever since. Today, KIITEC acts as the international training center where educators travel from different corners of Africa to upgrade their skills.
14
+
15
+ Resting on a 15-acre campus with hostel available inside it, KIITEC offers the most advanced targeted training technologies in the region. The innovative education model developed at KIITEC is based on a hands-on and student-centered approach to learning with full access to modern learning equipment simulating real-world practical experiences. The training center is registered and accredited by the National Council for Technical Education (NACTE) and awards successful graduates with a 3-year National Technical Award Level Six (NTA-6) Diploma.
16
+
17
+ KIITEC specializes in diploma programs including:
18
+ - Electrical & Computer Engineering
19
+ - Electrical & Industrial Automation
20
+ - Electronics & Telecommunication Engineering
21
+ - Electrical & Renewable Energies
22
+
23
+ Short course programs offered by KIITEC include:
24
+ - Computer Application
25
+ - IT & System Security
26
+ - Electrical Domestic & Solar PV System Installation
27
+
28
+ Future training programs or courses in development: Biomedical, Avionics.
29
+
30
+ ADMISSION REQUIREMENTS of ELECTRONICS AND TELECOMMUNICATION ENGINEERING:
31
+ - Possession of a Certificate of Secondary Education Examinations (CSEE) with a minimum of FOUR passes, of which TWO must be among the following subjects: Mathematics, Physics/Engineering Science, Biology, and Chemistry; excluding religious subjects.
32
+ - OR Possession of a National Vocational Award (NVA) Level III in Electrical, Electronics, Telecommunication, Mechanical, and related fields offered by VETA and a Certificate of Secondary Education Examination (CSEE) with at least two passes.
33
+
34
+ ADMISSION REQUIREMENTS of ELECTRICAL AND INDUSTRIAL AUTOMATION ENGINEERING:
35
+ - Possession of a Certificate of Secondary Education Examinations (CSEE) with a minimum of FOUR passes, of which TWO must be among the following subjects: Mathematics, Physics/Engineering Science, Biology, and Chemistry; excluding religious subjects.
36
+ - OR Possession of a National Vocational Award (NVA) Level III in Electrical, Electronics, Telecommunication, Mechanical, and related fields offered by VETA and a Certificate of Secondary Education Examination (CSEE) with at least two passes.
37
+
38
+ ADMISSION REQUIREMENTS of ELECTRICAL AND COMPUTER ENGINEERING PROGRAMS:
39
+ - Possession of a Certificate of Secondary Education Examinations (CSEE) with a minimum of FOUR passes, of which TWO must be among the following subjects: Mathematics, Physics/Engineering Science, Biology, and Chemistry; excluding religious subjects.
40
+ - OR Possession of a National Vocational Award (NVA) Level III in Electrical, Electronics, Telecommunication, Mechanical, and related fields offered by VETA and a Certificate of Secondary Education Examination (CSEE) with at least two passes.
41
+
42
+ ADMISSION REQUIREMENTS of ELECTRICAL AND RENEWABLE ENERGY ENGINEERING:
43
+ - Possession of a Certificate of Secondary Education Examinations (CSEE) with a minimum of FOUR passes, of which TWO must be among the following subjects: Mathematics, Physics/Engineering Science, Biology, and Chemistry; excluding religious subjects.
44
+ - OR Possession of a National Vocational Award (NVA) Level III in Electrical, Electronics, Telecommunication, Mechanical, and related fields offered by VETA and a Certificate of Secondary Education Examination (CSEE) with at least two passes.
45
+
46
+
47
+ APPLICATION FOR EITHER DIPLOMA COURSE OR SHORT COURSE
48
+ - You can apply for Diploma Course through this link https://kiitec.ac.tz/apply-here/
49
+ - You can apply for short Course through this link https://kiitec.ac.tz/apply-here/
50
+
51
+ Fee structure and Mode of Payment for Diploma Programs:
52
+ - The first semester fee is 695,000 Tsh and can be paid in two installments before the end of the semester.
53
+ - The second semester fee is 625,000 Tsh and can be paid in two installments before the end of the semester.
54
+ - The fees should be paid through the Bank of ABSA, Account number 002-4001687, Account Name KIITEC.
55
+
56
+ KIITEC students wear uniforms. The uniforms consist of light blue shirts and dark blue sweaters, dark blue skirts, and dark blue trousers.
57
+
58
+ KIITEC Vision:
59
+ To become a leading provider of quality technical education and training to empower the youth of Tanzania and the Eastern Africa region.
60
+
61
+ KIITEC Mission:
62
+ - To provide quality hands-on technical training for students in ICTs, Electrical, Renewable Energies, Industrial Automation, and related disciplines.
63
+ - To conduct quality research and consultancy in these fields.
64
+ - To promote the development and usage of modern technology that meets national, regional, and international needs and standards through skills and practical-oriented training.
65
+
66
+ KIITEC Values:
67
+ - Hard work and excellence
68
+ - Honesty
69
+ - Respect
70
+ - Responsibility
71
+ - Lifelong learning
72
+ - Innovation and creativity.
73
+
74
+ For contact information:
75
+ - Phone: +255 27 250 4384
76
+ - Mobile: +255 757 845 118
77
+ - Email: info@kiitec.ac.tz
78
+ - P.O. Box 3172, Arusha
79
+ """
80
+
81
+ def generate_response(user_input):
82
+ response = openai.ChatCompletion.create(
83
+ model="gpt-3.5-turbo",
84
+ messages=[
85
+ {"role": "system", "content": "All your answers should be in Swahili or English. Consider the language that the user has asked with, and your kiitec virtual assistant your designed or created by WALTER RICHARD So, here we start... Your virtual assistant of DON BOSCO KIITEC. You will reply to the queries that the user might ask!\n\n" + KIITEC_CONTENT},
86
+ {"role": "assistant", "content": "Hi, how can i assist you today?"},
87
+ {"role": "user", "content": user_input},
88
+ ]
89
+ )
90
+ return response['choices'][0]['message']['content']
91
+
92
+ def main():
93
+ st.title("KIITEC VIRTUAL ASSISTANT")
94
+ user_input = st.text_input("Enter your question:")
95
+ if st.button("Generate"):
96
+ with st.spinner("Generating Response...."):
97
+ response_text = generate_response(user_input)
98
+ st.write("Response:", response_text)
99
+
100
+ if __name__ == '__main__':
101
+ main()
102
+
103
+ def text_to_speech(text):
104
+ # Create a text-to-speech object
105
+ tts = gTTS(text=text, lang='en','sw')
106
+ # Save the audio file
107
+ tts.save('output.mp3')
108
+
109
+ # Play the audio file
110
+ st.audio("output.mp3")
111
+
112
+ # Call the text-to-speech function with some text
113
+ text_to_speech(predictions["response_text"])