david-oplatka commited on
Commit
bd6ffc4
·
verified ·
1 Parent(s): d41ae8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -3,8 +3,8 @@ from query import VectaraQuery
3
  import os
4
  import gradio as gr
5
 
6
- # import logging
7
- # logging.basicConfig(level=logging.DEBUG)
8
 
9
 
10
  def isTrue(x) -> bool:
@@ -31,7 +31,7 @@ vq = VectaraQuery(cfg.api_key, cfg.customer_id, cfg.corpus_ids, cfg.prompt_name)
31
  def respond(message, history):
32
  if cfg.streaming:
33
  # Call stream response and stream output
34
- # logging.debug(f'Streaming query called with message {message}')
35
  stream = vq.submit_query_streaming(message)
36
 
37
 
@@ -41,7 +41,9 @@ def respond(message, history):
41
  yield outputs
42
  else:
43
  # Call non-stream response and return message output
 
44
  response = vq.submit_query(message)
 
45
  yield response
46
 
47
  cfg.title = f'''<center> <img src="https://github.com/david-oplatka/chatbot-streamlit/blob/main/Vectara-logo.png?raw=true" width="200px" height="40px">
 
3
  import os
4
  import gradio as gr
5
 
6
+ import logging
7
+ logging.basicConfig(level=logging.DEBUG)
8
 
9
 
10
  def isTrue(x) -> bool:
 
31
  def respond(message, history):
32
  if cfg.streaming:
33
  # Call stream response and stream output
34
+ logging.debug(f'Streaming query called with message {message}')
35
  stream = vq.submit_query_streaming(message)
36
 
37
 
 
41
  yield outputs
42
  else:
43
  # Call non-stream response and return message output
44
+ logging.debug(f'Regular query called with message {message}')
45
  response = vq.submit_query(message)
46
+ logging.debug(f'Response message received: {response}')
47
  yield response
48
 
49
  cfg.title = f'''<center> <img src="https://github.com/david-oplatka/chatbot-streamlit/blob/main/Vectara-logo.png?raw=true" width="200px" height="40px">