bumk766fall2023 commited on
Commit
8a36aff
·
1 Parent(s): e576d64

Exploring logging

Browse files
Files changed (2) hide show
  1. app.py +5 -3
  2. images/log_data.txt +2 -0
app.py CHANGED
@@ -70,7 +70,7 @@ with gr.Blocks(theme = theme) as demo:
70
  #param_hiddentextbox = gr.Textbox(show_label=False, visible=False, container = False,)
71
  url_params = gr.State()
72
 
73
-
74
  demo.load(get_params, None, url_params, queue=False)
75
  #demo.load(get_params, param_hiddentextbox, param_hiddentextbox, queue=False)
76
 
@@ -109,7 +109,9 @@ with gr.Blocks(theme = theme) as demo:
109
  text = history[-1][0]
110
  print("User Input:", text)
111
 
112
-
 
 
113
  if text != "":
114
  search_keyword = find_best_keyword_match(keywords, text)
115
  else:
@@ -125,7 +127,7 @@ with gr.Blocks(theme = theme) as demo:
125
  bot_message = output_text
126
 
127
  if text == "debug":
128
- bot_message = "[DEBUG (params: " + url_params + "\nWords Delay=" + str(DelayBetweenWords) + " sec. Letters Delay=" + str(DelayBetweenLetters) + " sec.) \nKeys:\n" + "\n".join(keywords) + "]"
129
 
130
 
131
  # initialize new entry
 
70
  #param_hiddentextbox = gr.Textbox(show_label=False, visible=False, container = False,)
71
  url_params = gr.State()
72
 
73
+
74
  demo.load(get_params, None, url_params, queue=False)
75
  #demo.load(get_params, param_hiddentextbox, param_hiddentextbox, queue=False)
76
 
 
109
  text = history[-1][0]
110
  print("User Input:", text)
111
 
112
+ file_location = 'images/log_data.txt'
113
+ full_path = os.path.abspath(file_location)
114
+
115
  if text != "":
116
  search_keyword = find_best_keyword_match(keywords, text)
117
  else:
 
127
  bot_message = output_text
128
 
129
  if text == "debug":
130
+ bot_message = "[DEBUG (log file: " + full_path + " params: " + url_params + "\nWords Delay=" + str(DelayBetweenWords) + " sec. Letters Delay=" + str(DelayBetweenLetters) + " sec.) \nKeys:\n" + "\n".join(keywords) + "]"
131
 
132
 
133
  # initialize new entry
images/log_data.txt CHANGED
@@ -14,3 +14,5 @@
14
  2024-03-24 14:40:34: : -EXIT- [query]: debug [params] dw=0.02&dl=0.0001 [keyword] None
15
  2024-03-24 17:18:32: : -ENTRY- [query]: asasa [params] dw=0.02&dl=0.0001 [keyword] None
16
  2024-03-24 17:18:33: : -EXIT- [query]: asasa [params] dw=0.02&dl=0.0001 [keyword] None
 
 
 
14
  2024-03-24 14:40:34: : -EXIT- [query]: debug [params] dw=0.02&dl=0.0001 [keyword] None
15
  2024-03-24 17:18:32: : -ENTRY- [query]: asasa [params] dw=0.02&dl=0.0001 [keyword] None
16
  2024-03-24 17:18:33: : -EXIT- [query]: asasa [params] dw=0.02&dl=0.0001 [keyword] None
17
+ 2024-03-24 21:17:11: : -ENTRY- [query]: debug [params] dw=0.02&dl=0.0001 [keyword] None
18
+ 2024-03-24 21:17:12: : -EXIT- [query]: debug [params] dw=0.02&dl=0.0001 [keyword] None