AashitaK commited on
Commit
5779d70
·
verified ·
1 Parent(s): 9f2362b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,15 +1,18 @@
1
- import gradio as gr
2
  import pickle
 
3
  from chatbot import answer_query_with_context
4
  from file_utils import load_service_data, load_pickle
5
 
6
- df = load_service_data('services-links.csv')
7
- document_embeddings = load_pickle('document_embeddings.pkl')
 
 
 
8
 
9
  def chatbot(input):
10
  try:
11
  if input:
12
- reply = answer_query_with_context(input, df, document_embeddings)
13
  return reply
14
  except Exception as e:
15
  return str(e)
 
 
1
  import pickle
2
+ import gradio as gr
3
  from chatbot import answer_query_with_context
4
  from file_utils import load_service_data, load_pickle
5
 
6
+ database_filepath = 'services-links.csv'
7
+ embeddings_filepath = 'document_embeddings.pkl'
8
+
9
+ database = load_service_data(database_filepath)
10
+ database_embeddings = load_pickle(embeddings_filepath)
11
 
12
  def chatbot(input):
13
  try:
14
  if input:
15
+ reply = answer_query_with_context(input, database, database_embeddings)
16
  return reply
17
  except Exception as e:
18
  return str(e)