Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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) # Set the logging level to DEBUG or INFO
|
8 |
|
9 |
|
10 |
def isTrue(x) -> bool:
|
@@ -28,7 +28,7 @@ cfg = OmegaConf.create({
|
|
28 |
vq = VectaraQuery(cfg.api_key, cfg.customer_id, cfg.corpus_ids, cfg.prompt_name)
|
29 |
|
30 |
def respond(message, history):
|
31 |
-
logging.debug(f"Calling respond function with message {message}")
|
32 |
if cfg.streaming:
|
33 |
# Call stream response and stream output
|
34 |
stream = vq.submit_query_streaming(message)
|
@@ -39,10 +39,10 @@ def respond(message, history):
|
|
39 |
outputs += output
|
40 |
yield outputs
|
41 |
else:
|
42 |
-
logging.debug("Calling non-stream response")
|
43 |
# Call non-stream response and return message output
|
44 |
response = vq.submit_query(message)
|
45 |
-
logging.debug(f"Received response: {response}")
|
46 |
# yield response
|
47 |
return response
|
48 |
|
|
|
3 |
import os
|
4 |
import gradio as gr
|
5 |
|
6 |
+
# import logging
|
7 |
+
# logging.basicConfig(level=logging.DEBUG) # Set the logging level to DEBUG or INFO
|
8 |
|
9 |
|
10 |
def isTrue(x) -> bool:
|
|
|
28 |
vq = VectaraQuery(cfg.api_key, cfg.customer_id, cfg.corpus_ids, cfg.prompt_name)
|
29 |
|
30 |
def respond(message, history):
|
31 |
+
# logging.debug(f"Calling respond function with message {message}")
|
32 |
if cfg.streaming:
|
33 |
# Call stream response and stream output
|
34 |
stream = vq.submit_query_streaming(message)
|
|
|
39 |
outputs += output
|
40 |
yield outputs
|
41 |
else:
|
42 |
+
# logging.debug("Calling non-stream response")
|
43 |
# Call non-stream response and return message output
|
44 |
response = vq.submit_query(message)
|
45 |
+
# logging.debug(f"Received response: {response}")
|
46 |
# yield response
|
47 |
return response
|
48 |
|