MVPilgrim commited on
Commit
0550657
·
1 Parent(s): 0e3a980
Files changed (1) hide show
  1. semsearchDbgUI.py +8 -42
semsearchDbgUI.py CHANGED
@@ -6,7 +6,7 @@ st.markdown("<h1 style='text-align: center; color: #666666;'>Vector Database RAG
6
  st.markdown("<h6 style='text-align: center; color: #666666;'>V1</h6>", unsafe_allow_html=True)
7
 
8
  logger = logging.getLogger(__name__)
9
- logging.basicConfig(level=logging.INFO)
10
 
11
 
12
 
@@ -15,64 +15,30 @@ logging.basicConfig(level=logging.INFO)
15
  #
16
  logger.info("#### MAINLINE ENTERED.")
17
 
18
-
19
-
20
  systemTextArea = st.empty()
21
  userTextArea = st.empty()
22
  ragPromptTextArea = st.empty()
23
  responseTextArea = st.empty()
24
- selectRag = st.checkbox("Enable Query With RAG",
25
- value=False,
26
- key="selectRag",
27
- help=None,
28
- on_change=None,
29
- args=None,
30
- kwargs=None,
31
- *,
32
- disabled=False,
33
- label_visibility="visible"
34
- )
35
- submitButton = st.button(label,
36
- key=None,
37
- help=None,
38
- on_click=None,
39
- args=None,
40
- kwargs=None,
41
- *, type="secondary",
42
- disabled=False,
43
- use_container_width=False
44
- )
45
-
46
 
47
- # Display UI
48
- logger.debug("### Before displaying UI: ")
49
- display(systemTextArea)
50
- display(userTextArea)
51
- display(ragPromptTextArea)
52
- display(responseTextArea)
53
- display(selectRag)
54
- display(submitButton)
55
 
56
  def runLLM(prompt):
 
57
  result = ""
58
  return(result)
59
 
60
  def setPrompt(pprompt,ragFlag):
 
61
  userPrompt = ""
62
  return userPrompt
63
 
64
 
65
  def on_submitButton_clicked(b):
66
- with output_widget:
67
- clear_output(wait=True)
68
- ragPromptTextArea.value = ""
69
- responseTextArea.value = ""
70
- log.debug(f"### selectRag: {selectRag.value}")
71
- prompt = setPrompt(userTextArea.value,selectRag.value)user
72
- log.debug("### prompt: " + prompt)
73
- runLLM(prompt)
74
 
75
  logger.info("\n### Before calling submitButton.on_click().")
76
  submitButton.on_click(on_submitButton_clicked)
77
- display(output_widget)
78
 
 
6
  st.markdown("<h6 style='text-align: center; color: #666666;'>V1</h6>", unsafe_allow_html=True)
7
 
8
  logger = logging.getLogger(__name__)
9
+ logging.basicConfig(level=logging.DEBUG)
10
 
11
 
12
 
 
15
  #
16
  logger.info("#### MAINLINE ENTERED.")
17
 
 
 
18
  systemTextArea = st.empty()
19
  userTextArea = st.empty()
20
  ragPromptTextArea = st.empty()
21
  responseTextArea = st.empty()
22
+ selectRag = st.checkbox("Enable Query With RAG",value=False,key="selectRag",help=None,on_change=None,args=None,kwargs=None,*,disabled=False,label_visibility="visible")
23
+ submitButton = st.button(label,key=None,help=None,on_click=on_submitButton_clicked,args=None,kwargs=None,*,type="secondary",disabled=False,use_container_width=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
 
 
 
 
 
 
 
 
25
 
26
  def runLLM(prompt):
27
+ log.debug("### runLLM")
28
  result = ""
29
  return(result)
30
 
31
  def setPrompt(pprompt,ragFlag):
32
+ log.debug("### setPrompt")
33
  userPrompt = ""
34
  return userPrompt
35
 
36
 
37
  def on_submitButton_clicked(b):
38
+ log.debug("### on_submitButton_clicked")
39
+ setPrompt("","")
40
+ runLLM(prompt)
 
 
 
 
 
41
 
42
  logger.info("\n### Before calling submitButton.on_click().")
43
  submitButton.on_click(on_submitButton_clicked)
 
44