Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,24 +19,6 @@ 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 |
-
with gr.Blocks() as demo:
|
| 23 |
-
cool_button = gr.Button(value="Cool Mom", variant="primary")
|
| 24 |
-
cool_button.click(fn=respond_cool, inputs=[], outputs=[])
|
| 25 |
-
|
| 26 |
-
demo.launch()
|
| 27 |
-
|
| 28 |
-
with gr.Blocks() as demo:
|
| 29 |
-
tutor_button = gr.Button(value="Tutor Mom", variant="primary")
|
| 30 |
-
tutor_button.click(fn=respond_tutor, inputs=[], outputs=[])
|
| 31 |
-
|
| 32 |
-
demo.launch()
|
| 33 |
-
|
| 34 |
-
with gr.Blocks() as demo:
|
| 35 |
-
strict_button = gr.Button(value="Strict Mom", variant="primary")
|
| 36 |
-
strict_button.click(fn=respond_strict, inputs=[], outputs=[])
|
| 37 |
-
|
| 38 |
-
demo.launch()
|
| 39 |
-
|
| 40 |
|
| 41 |
# STEP 3 FROM SEMANTIC SEARCH
|
| 42 |
def preprocess_text(text):
|
|
@@ -205,6 +187,25 @@ def respond_strict(message, history):
|
|
| 205 |
return response['choices'][0]['message']['content'].strip()
|
| 206 |
|
| 207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
|
| 209 |
chatbot = gr.ChatInterface(respond, type = 'messages')
|
| 210 |
chatbot.launch()
|
|
|
|
| 19 |
# Read the entire contents of the file and store it in a variable
|
| 20 |
strict_mom_text = file.read()
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# STEP 3 FROM SEMANTIC SEARCH
|
| 24 |
def preprocess_text(text):
|
|
|
|
| 187 |
return response['choices'][0]['message']['content'].strip()
|
| 188 |
|
| 189 |
|
| 190 |
+
with gr.Blocks() as demo:
|
| 191 |
+
cool_button = gr.Button(value="Cool Mom", variant="primary")
|
| 192 |
+
cool_button.click(fn=respond_cool, inputs=[], outputs=[])
|
| 193 |
+
|
| 194 |
+
demo.launch()
|
| 195 |
+
|
| 196 |
+
with gr.Blocks() as demo:
|
| 197 |
+
tutor_button = gr.Button(value="Tutor Mom", variant="primary")
|
| 198 |
+
tutor_button.click(fn=respond_tutor, inputs=[], outputs=[])
|
| 199 |
+
|
| 200 |
+
demo.launch()
|
| 201 |
+
|
| 202 |
+
with gr.Blocks() as demo:
|
| 203 |
+
strict_button = gr.Button(value="Strict Mom", variant="primary")
|
| 204 |
+
strict_button.click(fn=respond_strict, inputs=[], outputs=[])
|
| 205 |
+
|
| 206 |
+
demo.launch()
|
| 207 |
+
|
| 208 |
+
|
| 209 |
|
| 210 |
chatbot = gr.ChatInterface(respond, type = 'messages')
|
| 211 |
chatbot.launch()
|