reannajlee commited on
Commit
eabbef8
·
verified ·
1 Parent(s): ef2c296

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,7 +6,7 @@ import os
6
  os.environ["TOKENIZERS_PARALLELISM"] = "false"
7
 
8
  # Initialize paths and model identifiers for easy configuration and maintenance
9
- filename = "output_topic_details.txt" # Path to the file storing chess-specific details
10
  retrieval_model_name = 'output/sentence-transformer-finetuned/'
11
 
12
  openai.api_key = os.environ["OPENAI_API_KEY"]
@@ -67,7 +67,7 @@ def generate_response(user_query, relevant_segment):
67
  Generate a response emphasizing the bot's capability in providing playlist titles.
68
  """
69
  try:
70
- user_message = f"Here's the information on chess: {relevant_segment}"
71
 
72
  # Append user's message to messages list
73
  messages.append({"role": "user", "content": user_message})
@@ -99,7 +99,7 @@ def query_model(question):
99
  Process a question, find relevant information, and generate a response.
100
  """
101
  if question == "":
102
- return "Welcome to ChessBot! Ask me anything about chess rules, strategies, and terminology."
103
  relevant_segment = find_relevant_segment(question, segments)
104
  if not relevant_segment:
105
  return "Hmmm, that doesn't seem to be in my database. I'm sorry!"
 
6
  os.environ["TOKENIZERS_PARALLELISM"] = "false"
7
 
8
  # Initialize paths and model identifiers for easy configuration and maintenance
9
+ filename = "output_topic_details.txt" # Path to the file storing music-specific details
10
  retrieval_model_name = 'output/sentence-transformer-finetuned/'
11
 
12
  openai.api_key = os.environ["OPENAI_API_KEY"]
 
67
  Generate a response emphasizing the bot's capability in providing playlist titles.
68
  """
69
  try:
70
+ user_message = f"Here's a playlist name: {relevant_segment}"
71
 
72
  # Append user's message to messages list
73
  messages.append({"role": "user", "content": user_message})
 
99
  Process a question, find relevant information, and generate a response.
100
  """
101
  if question == "":
102
+ return "Welcome to Fillira!"
103
  relevant_segment = find_relevant_segment(question, segments)
104
  if not relevant_segment:
105
  return "Hmmm, that doesn't seem to be in my database. I'm sorry!"