Cperkins14 commited on
Commit
5638501
·
verified ·
1 Parent(s): fa3ae63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
app.py CHANGED
@@ -63,7 +63,7 @@ def generate_response(user_query, relevant_segment):
63
  Generate a response emphasizing the bot's capability in providing chess information.
64
  """
65
  try:
66
- system_message = "You are a chess chatbot specialized in providing information on chess rules, strategies, and terminology."
67
  user_message = f"Here's the information on chess: {relevant_segment}"
68
  messages = [
69
  {"role": "system", "content": system_message},
@@ -88,7 +88,7 @@ def query_model(question):
88
  Process a question, find relevant information, and generate a response.
89
  """
90
  if question == "":
91
- return "Welcome to ChessBot! Ask me anything about chess rules, strategies, and terminology."
92
  relevant_segment = find_relevant_segment(question, segments)
93
  if not relevant_segment:
94
  return "Could not find specific information. Please refine your question."
@@ -99,18 +99,15 @@ def query_model(question):
99
  welcome_message = """
100
  # ♟️ Welcome to ChessBot!
101
 
102
- ## Your AI-driven assistant for all chess-related queries.
103
  """
104
 
105
  topics = """
106
  ### Feel Free to ask me anything from the topics below!
107
- - Chess piece movements
108
- - Special moves
109
- - Game phases
110
- - Common strategies
111
- - Chess terminology
112
- - Famous games
113
- - Chess tactics
114
  """
115
 
116
  # Setup the Gradio Blocks interface with custom layout components
@@ -122,7 +119,7 @@ with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
122
  with gr.Row():
123
  with gr.Column():
124
  question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
125
- answer = gr.Textbox(label="ChessBot Response", placeholder="ChessBot will respond here...", interactive=False, lines=10)
126
  submit_button = gr.Button("Submit")
127
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
128
 
 
63
  Generate a response emphasizing the bot's capability in providing chess information.
64
  """
65
  try:
66
+ system_message = "You are a study chatbot specialized in providing information on helping students create healthy and effective study habits."
67
  user_message = f"Here's the information on chess: {relevant_segment}"
68
  messages = [
69
  {"role": "system", "content": system_message},
 
88
  Process a question, find relevant information, and generate a response.
89
  """
90
  if question == "":
91
+ return "Welcome to StudyBot! Ask me anything about the Pomodoro Technique, Study Strategies, or Healthy Study Habits."
92
  relevant_segment = find_relevant_segment(question, segments)
93
  if not relevant_segment:
94
  return "Could not find specific information. Please refine your question."
 
99
  welcome_message = """
100
  # ♟️ Welcome to ChessBot!
101
 
102
+ ## Your AI-driven assistant for all study-related queries.
103
  """
104
 
105
  topics = """
106
  ### Feel Free to ask me anything from the topics below!
107
+ - Pomodoro Technique
108
+ -Time management
109
+ -healthy habits
110
+ taking breaks
 
 
 
111
  """
112
 
113
  # Setup the Gradio Blocks interface with custom layout components
 
119
  with gr.Row():
120
  with gr.Column():
121
  question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
122
+ answer = gr.Textbox(label="StudyBot Response", placeholder="StudyBot will respond here...", interactive=False, lines=10)
123
  submit_button = gr.Button("Submit")
124
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
125