try
Browse files
app.py
CHANGED
|
@@ -4,26 +4,6 @@ from huggingface_hub import InferenceClient
|
|
| 4 |
from sentence_transformers import SentenceTransformer
|
| 5 |
import torch
|
| 6 |
|
| 7 |
-
with gr.Blocks(theme='hmb/amethyst') as demo:
|
| 8 |
-
with gr.Row(equal_height=True):
|
| 9 |
-
with gr.Column(scale=10):
|
| 10 |
-
gr.Markdown(
|
| 11 |
-
"""
|
| 12 |
-
# 🎁 Introducing WrapIT!
|
| 13 |
-
**WrapIT** helps users find personalized gift ideas and craft thoughtful card messages
|
| 14 |
-
by inputting details like the recipient's interests, celebration type, and budget.
|
| 15 |
-
|
| 16 |
-
✨ *All you have to do is wrap it.*
|
| 17 |
-
"""
|
| 18 |
-
)
|
| 19 |
-
|
| 20 |
-
chatbot = gr.Chatbot()
|
| 21 |
-
msg = gr.Textbox(placeholder="Say hi to WrapIT here!")
|
| 22 |
-
send = gr.Button("Send")
|
| 23 |
-
|
| 24 |
-
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
| 25 |
-
send.click(respond, [msg, chatbot], [msg, chatbot])
|
| 26 |
-
|
| 27 |
|
| 28 |
with open("knowledge.txt", "r", encoding="utf-8") as file:
|
| 29 |
recent = file.read()
|
|
@@ -108,6 +88,26 @@ def respond(message,history):
|
|
| 108 |
|
| 109 |
#yield response["choices"][0]["message"]["content"].strip()
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
chatbot = gr.ChatInterface(respond, type='messages', theme='hmb/amethyst')
|
| 112 |
chatbot.launch(debug=True)
|
| 113 |
demo.launch()
|
|
|
|
| 4 |
from sentence_transformers import SentenceTransformer
|
| 5 |
import torch
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
with open("knowledge.txt", "r", encoding="utf-8") as file:
|
| 9 |
recent = file.read()
|
|
|
|
| 88 |
|
| 89 |
#yield response["choices"][0]["message"]["content"].strip()
|
| 90 |
|
| 91 |
+
with gr.Blocks(theme='hmb/amethyst') as demo:
|
| 92 |
+
with gr.Row(equal_height=True):
|
| 93 |
+
with gr.Column(scale=10):
|
| 94 |
+
gr.Markdown(
|
| 95 |
+
"""
|
| 96 |
+
# 🎁 Introducing WrapIT!
|
| 97 |
+
**WrapIT** helps users find personalized gift ideas and craft thoughtful card messages
|
| 98 |
+
by inputting details like the recipient's interests, celebration type, and budget.
|
| 99 |
+
|
| 100 |
+
✨ *All you have to do is wrap it.*
|
| 101 |
+
"""
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
chatbot = gr.Chatbot()
|
| 105 |
+
msg = gr.Textbox(placeholder="Say hi to WrapIT here!")
|
| 106 |
+
send = gr.Button("Send")
|
| 107 |
+
|
| 108 |
+
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
| 109 |
+
send.click(respond, [msg, chatbot], [msg, chatbot])
|
| 110 |
+
|
| 111 |
chatbot = gr.ChatInterface(respond, type='messages', theme='hmb/amethyst')
|
| 112 |
chatbot.launch(debug=True)
|
| 113 |
demo.launch()
|