dogutcu commited on
Commit
55fb31a
·
verified ·
1 Parent(s): 8db6a7a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -9
app.py CHANGED
@@ -64,14 +64,6 @@ def generate_response(user_query, relevant_segment):
64
  """
65
  Generate a response emphasizing the bot's capability to provide information related to composting food.
66
  """
67
- generator = pipeline("text-davinci-003", device=0)
68
- response = generator(query=f"Here's the information on composting: {relevant_segment} {user_query}", max_length=150, temperature=0.2, top_p=1)
69
- generated_text = response[0]['generated_text'].strip()
70
- confidence_score = response[0]['score']
71
-
72
- return generated_text, confidence_score
73
-
74
- '''
75
  try:
76
  system_message = "You are a chatbot specialized in providing information about food composting tips, tricks, and basics."
77
  user_message = f"Here's the information on composting: {relevant_segment}"
@@ -92,7 +84,6 @@ def generate_response(user_query, relevant_segment):
92
  except Exception as e:
93
  print(f"Error in generating response: {e}")
94
  return f"Error in generating response: {e}"
95
- '''
96
 
97
 
98
  def query_model(question):
 
64
  """
65
  Generate a response emphasizing the bot's capability to provide information related to composting food.
66
  """
 
 
 
 
 
 
 
 
67
  try:
68
  system_message = "You are a chatbot specialized in providing information about food composting tips, tricks, and basics."
69
  user_message = f"Here's the information on composting: {relevant_segment}"
 
84
  except Exception as e:
85
  print(f"Error in generating response: {e}")
86
  return f"Error in generating response: {e}"
 
87
 
88
 
89
  def query_model(question):