Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 23 |
-
|
| 24 |
|
| 25 |
with gr.Blocks() as demo:
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
output_text = gr.Textbox(label="Greeting")
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|