yogarajas commited on
Commit
2b5ce71
·
verified ·
1 Parent(s): ac435d3
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import gradio as gr
2
  import random
3
- import numpy as np
4
  from huggingface_hub import InferenceClient
5
  from sentence_transformers import SentenceTransformer
6
 
@@ -25,7 +24,7 @@ with open("knowledge.txt", "r", encoding="utf-8") as f:
25
 
26
 
27
  def tac_chatbot(message, history):
28
- messages = [{"role": "system", "content":"Your name is CASP. You are running a college interactive quiz. This is the quiz questions: What grade are you in? Share any awards/standardized testing scores. What are your major interests or field of study? What is your desired competitiveness level? Do you have a preferred location or region? What is your approximate budget for college?, Give a very detailed summarization of their answers, send the results and save them in the college information tab, and tell the user that their results have been saved and to then move into the College Information Tab. Be conversational and only ask one question at a time. Using these results, act as a highly empathetic and expert personal college guidance advisor and academic counselor. Your sole mission is to provide deeply personalized, actionable, and structured college and summer program recommendations based directly on a user's needs. When reviewing the user's data, you will analyze their academic profile, including their current grades, GPA, and test scores, alongside their specific personal preferences such as major or area of interest, desired competitiveness level ranging from highly competitive to safety options, location preferences including in-state versus out-of-state, and campus vibe or program type. Once you have absorbed their results, you will synthesize this information to craft a comprehensive, encouraging, and highly detailed recommendation report. You will begin your response with a warm, welcoming introduction that establishes a supportive, mentorship-based tone. Following this introduction, you will provide a categorized breakdown of colleges that fit their exact profile, explicitly dividing your suggestions into tiers such as reach, target, and likely or safety schools, or alternatively categorizing summer programs by skill level and intensity. For each recommendation, you must explain exactly why the institution or program aligns with their preferences, detailing key attributes such as average accepted GPA, program strengths in their intended major, campus culture, location, and the level of selectivity. You will then provide concrete, actionable next steps tailored to their current grade level, such as suggesting standardized testing timelines, specific extracurricular activities, or campus visits they should prioritize. You must base your recommendations entirely on realistic educational data and avoid making up false programs, universities, or statistics, always ensuring your advice is structured logically and reads like an expert counselor who is fully invested in the student's success. Your tone should be encouraging, professional, and accessible, ensuring the student leaves the conversation feeling informed, motivated, and make sure to give a clear roadmap on what to do next to optimize their chances for success in college admissions for their academic future."}]
29
 
30
  if history:
31
  messages.extend(history)
@@ -40,19 +39,19 @@ def tac_chatbot(message, history):
40
  tac = gr.ChatInterface(
41
  tac_chatbot,
42
  title="Tamil Association of Colorado",
43
- description="Personalized college recommendations based on your interests.",
44
  textbox=gr.Textbox(placeholder="Ask Me Anything..."),
45
  examples=[
46
- "Let's start the quiz!",
47
- "I want to study Computer Science at a target school.",
48
- "What affordable colleges have strong pre med programs?"
49
  ]
50
  )
51
 
52
 
53
 
54
  with gr.Blocks(theme=custom_theme) as demo:
55
- gr.Image(value="Casp2.png", show_label=False, elem_id="top-image")
56
  gr.Markdown("""
57
  <div style="text-align:center">
58
  <h1 class="glow">Hi, I'm TAC Bot! </h1>
@@ -78,4 +77,4 @@ I'm going to help you with any questions you have for us:
78
 
79
  gr.TabbedInterface([tac], [ "TAC Information" ])
80
 
81
- demo.launch(debug="True")
 
1
  import gradio as gr
2
  import random
 
3
  from huggingface_hub import InferenceClient
4
  from sentence_transformers import SentenceTransformer
5
 
 
24
 
25
 
26
  def tac_chatbot(message, history):
27
+ messages = [{"role": "system", "content":"You are a friendly chatbot, who can help Tamil people with their queries about Tamil Association. You can speak tamil if they ask for it in Tamil, and you must address them as nanbi, or nanba(meaning friend). If it's not in the database then you must give them this contact: (https://tamilcolorado.org/). "}]
28
 
29
  if history:
30
  messages.extend(history)
 
39
  tac = gr.ChatInterface(
40
  tac_chatbot,
41
  title="Tamil Association of Colorado",
42
+ description="Hello Nanba,",
43
  textbox=gr.Textbox(placeholder="Ask Me Anything..."),
44
  examples=[
45
+ "How to get membership?",
46
+ "Who is the current president?",
47
+ "What is the history of TAC?"
48
  ]
49
  )
50
 
51
 
52
 
53
  with gr.Blocks(theme=custom_theme) as demo:
54
+ gr.Image(value="logo.png", show_label=False, elem_id="top-image")
55
  gr.Markdown("""
56
  <div style="text-align:center">
57
  <h1 class="glow">Hi, I'm TAC Bot! </h1>
 
77
 
78
  gr.TabbedInterface([tac], [ "TAC Information" ])
79
 
80
+ demo.launch(debug=True)