hpeskoff commited on
Commit
33352e0
·
verified ·
1 Parent(s): 4f76208

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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"]
@@ -64,10 +64,10 @@ def find_relevant_segment(user_query, segments):
64
 
65
  def generate_response(user_query, relevant_segment):
66
  """
67
- Generate a response emphasizing the bot's capability in providing chess information.
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})
@@ -129,7 +129,7 @@ with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
129
  with gr.Row():
130
  with gr.Column():
131
  question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
132
- answer = gr.Textbox(label="ChessBot Response", placeholder="ChessBot will respond here...", interactive=False, lines=10)
133
  submit_button = gr.Button("Submit")
134
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
135
 
 
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 recipe-specific details
10
  retrieval_model_name = 'output/sentence-transformer-finetuned/'
11
 
12
  openai.api_key = os.environ["OPENAI_API_KEY"]
 
64
 
65
  def generate_response(user_query, relevant_segment):
66
  """
67
+ Generate a response emphasizing the bot's capability in providing sustainable recipe information.
68
  """
69
  try:
70
+ user_message = f"Here's the information on the recipe: {relevant_segment}"
71
 
72
  # Append user's message to messages list
73
  messages.append({"role": "user", "content": user_message})
 
129
  with gr.Row():
130
  with gr.Column():
131
  question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
132
+ answer = gr.Textbox(label="SustainAIBot Response", placeholder="SustainAIBot will respond here...", interactive=False, lines=10)
133
  submit_button = gr.Button("Submit")
134
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
135