riyamalshe commited on
Commit
c754608
·
verified ·
1 Parent(s): 929ea1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -19,18 +19,28 @@ with open("strict_mom_phrases.txt", "r", encoding="utf-8") as file:
19
  # Read the entire contents of the file and store it in a variable
20
  strict_mom_text = file.read()
21
 
22
- def greet(name):
23
- return f"Hello, {name}!"
24
 
25
  with gr.Blocks() as demo:
26
- name_input = gr.Textbox(label="Enter your name")
27
- greet_button = gr.Button(value="Say Hello!", variant="primary")
28
- output_text = gr.Textbox(label="Greeting")
29
 
30
- greet_button.click(fn=greet, inputs=name_input, outputs=output_text)
 
 
 
 
 
 
 
 
 
 
31
 
32
  demo.launch()
33
 
 
34
  # STEP 3 FROM SEMANTIC SEARCH
35
  def preprocess_text(text):
36
  # Strip extra whitespace from the beginning and the end of the text
 
19
  # Read the entire contents of the file and store it in a variable
20
  strict_mom_text = file.read()
21
 
22
+ def on_button_click():
23
+ if cool_button
24
 
25
  with gr.Blocks() as demo:
26
+ cool_button = gr.Button(value="Cool Mom", variant="primary")
27
+ cool_button.click(fn=on_button_click, inputs=[], outputs=[])
 
28
 
29
+ demo.launch()
30
+
31
+ with gr.Blocks() as demo:
32
+ tutor_button = gr.Button(value="Tutor Mom", variant="primary")
33
+ tutor_button.click(fn=on_button_click, inputs=[], outputs=[])
34
+
35
+ demo.launch()
36
+
37
+ with gr.Blocks() as demo:
38
+ strict_button = gr.Button(value="Strict Mom", variant="primary")
39
+ strict_button.click(fn=on_button_click, inputs=[], outputs=[])
40
 
41
  demo.launch()
42
 
43
+
44
  # STEP 3 FROM SEMANTIC SEARCH
45
  def preprocess_text(text):
46
  # Strip extra whitespace from the beginning and the end of the text