pgurazada1 commited on
Commit
f9f7463
1 Parent(s): 8411c27

Update chat_interface.py

Browse files
Files changed (1) hide show
  1. chat_interface.py +5 -6
chat_interface.py CHANGED
@@ -26,7 +26,7 @@ Please answer user questions ONLY using the context provided in the input and th
26
  DO NOT mention anything about the context in your final answer.
27
  Your response should only contain the answer to the question AND NOTHING ELSE.
28
 
29
- If the answer is not found in the context, respond "Sorry, I cannot answer your question. Please contact our representative on the hotline 1-800-AWESOMEINSURER".
30
  """
31
 
32
  qna_user_message_template = """
@@ -62,7 +62,7 @@ embedding_model = AnyscaleEmbeddings(
62
  model='thenlper/gte-large'
63
  )
64
 
65
- chromadb_client = chromadb.PersistentClient(path='./policy_db')
66
 
67
  vectorstore_persisted = Chroma(
68
  client=chromadb_client,
@@ -114,7 +114,7 @@ def predict(input: str, history):
114
 
115
  prediction = response.choices[0].message.content.strip()
116
  except Exception as e:
117
- prediction = f'Sorry, please contact our hotline: 1-800-AWESOMEINSURER'
118
 
119
  return prediction
120
 
@@ -125,10 +125,9 @@ demo = gr.ChatInterface(
125
  "Are hospitalization charges included in my policy?"
126
  ],
127
  cache_examples=False,
128
- title="Know Your Travel Insurance Policy Better",
129
- description="Feel free to ask me any query you might have about your travel insurance policy",
130
  concurrency_limit=8,
131
  show_progress="full"
132
  )
133
 
134
- demo.launch()
 
26
  DO NOT mention anything about the context in your final answer.
27
  Your response should only contain the answer to the question AND NOTHING ELSE.
28
 
29
+ If the answer is not found in the context, respond "Sorry, I cannot answer your question at this point. Please contact our hotline: 1-800-INSURANCE".
30
  """
31
 
32
  qna_user_message_template = """
 
62
  model='thenlper/gte-large'
63
  )
64
 
65
+ chromadb_client = chromadb.PersistentClient(path='./health_policy_db')
66
 
67
  vectorstore_persisted = Chroma(
68
  client=chromadb_client,
 
114
 
115
  prediction = response.choices[0].message.content.strip()
116
  except Exception as e:
117
+ prediction = f"Sorry, I cannot answer your question at this point. Please contact our hotline: 1-800-INSURANCE"
118
 
119
  return prediction
120
 
 
125
  "Are hospitalization charges included in my policy?"
126
  ],
127
  cache_examples=False,
128
+ title="Chat about information in your insurance policy",
 
129
  concurrency_limit=8,
130
  show_progress="full"
131
  )
132
 
133
+ demo.launch(auth=("demouser", os.getenv('PASSWD')))