philmui commited on
Commit
42db468
1 Parent(s): cd4563b

updated formatting

Browse files
Files changed (2) hide show
  1. app.py +10 -13
  2. semantic.py +1 -1
app.py CHANGED
@@ -29,7 +29,7 @@ async def main(message: cl.Message):
29
  response = _semantic_rag_chain.invoke({"question": message.content})
30
  content += response["response"].content
31
  except Exception as e:
32
- print(f"chat error: {e}: {vars(_semantic_rag_chain)}")
33
 
34
  # Send a response back to the user
35
  await cl.Message(
@@ -39,20 +39,17 @@ async def main(message: cl.Message):
39
  @cl.on_chat_start
40
  async def start():
41
 
42
- print("==> starting ...")
43
  global _semantic_rag_chain
44
  _semantic_rag_chain = SemanticRAGChainFactory.get_semantic_rag_chain()
45
 
46
- # await cl.Avatar(
47
- # name="Chatbot",
48
- # url="https://cdn-icons-png.flaticon.com/512/8649/8649595.png"
49
- # ).send()
50
- # await cl.Avatar(
51
- # name="User",
52
- # url="https://media.architecturaldigest.com/photos/5f241de2c850b2a36b415024/master/w_1600%2Cc_limit/Luke-logo.png"
53
- # ).send()
54
-
55
- print("\tsending message back: ready!!!")
56
 
57
  content = ""
58
  if _semantic_rag_chain is not None:
@@ -73,4 +70,4 @@ async def start():
73
  await cl.Message(
74
  content=content + "\nHow can I help you with Meta's 2023 10K?"
75
  ).send()
76
- print(f"{20 * '*'}")
 
29
  response = _semantic_rag_chain.invoke({"question": message.content})
30
  content += response["response"].content
31
  except Exception as e:
32
+ _logger.error(f"chat error: {e}: {vars(_semantic_rag_chain)}")
33
 
34
  # Send a response back to the user
35
  await cl.Message(
 
39
  @cl.on_chat_start
40
  async def start():
41
 
 
42
  global _semantic_rag_chain
43
  _semantic_rag_chain = SemanticRAGChainFactory.get_semantic_rag_chain()
44
 
45
+ await cl.Avatar(
46
+ name="Chatbot",
47
+ url="https://cdn-icons-png.flaticon.com/512/8649/8649595.png"
48
+ ).send()
49
+ await cl.Avatar(
50
+ name="User",
51
+ url="https://media.architecturaldigest.com/photos/5f241de2c850b2a36b415024/master/w_1600%2Cc_limit/Luke-logo.png"
52
+ ).send()
 
 
53
 
54
  content = ""
55
  if _semantic_rag_chain is not None:
 
70
  await cl.Message(
71
  content=content + "\nHow can I help you with Meta's 2023 10K?"
72
  ).send()
73
+ _logger.info(f"{20 * '*'}")
semantic.py CHANGED
@@ -138,7 +138,7 @@ class SemanticStoreFactory:
138
  cls._semantic_vectorstore = cls.__create_semantic_store()
139
  _logger.info(f"received semantic_vectorstore")
140
  else:
141
- print(f"Loading semantic vectorstore {META_SEMANTIC_COLLECTION} from: {VECTOR_STORE_PATH}")
142
  try:
143
  # first try to load the store
144
  cls._semantic_vectorstore = cls.__load_semantic_store()
 
138
  cls._semantic_vectorstore = cls.__create_semantic_store()
139
  _logger.info(f"received semantic_vectorstore")
140
  else:
141
+ _logger.info(f"Loading semantic vectorstore {META_SEMANTIC_COLLECTION} from: {VECTOR_STORE_PATH}")
142
  try:
143
  # first try to load the store
144
  cls._semantic_vectorstore = cls.__load_semantic_store()