Spaces:
Runtime error
Runtime error
added examples
Browse files
app.py
CHANGED
|
@@ -41,7 +41,7 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta", provider="hf-inference"
|
|
| 41 |
def respond(message, history):
|
| 42 |
|
| 43 |
info = pull_relevant_info(message, top_k=3)
|
| 44 |
-
system_message = (f"You are a helpful and kind teacher. You respond clearly in no more than three complete sentences. Use the following information to help answer the user's question:\n\n{info}\n\n")
|
| 45 |
messages = [{"role": "system", "content": system_message}]
|
| 46 |
|
| 47 |
if history:
|
|
@@ -82,7 +82,12 @@ with gr.Blocks() as chatbot:
|
|
| 82 |
with gr.Column():
|
| 83 |
gr.ChatInterface(
|
| 84 |
fn=respond,
|
| 85 |
-
type="messages"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
)
|
| 87 |
# chatbot = gr.ChatInterface(respond, type="messages")
|
| 88 |
|
|
|
|
| 41 |
def respond(message, history):
|
| 42 |
|
| 43 |
info = pull_relevant_info(message, top_k=3)
|
| 44 |
+
system_message = (f"You are a helpful and kind teacher named Ms. Honey. You respond clearly in no more than three complete sentences. If a user asks you to write something for them, you refuse and remind them they are capable of writing the piece themselves. Use the following information to help answer the user's question:\n\n{info}\n\n")
|
| 45 |
messages = [{"role": "system", "content": system_message}]
|
| 46 |
|
| 47 |
if history:
|
|
|
|
| 82 |
with gr.Column():
|
| 83 |
gr.ChatInterface(
|
| 84 |
fn=respond,
|
| 85 |
+
type="messages",
|
| 86 |
+
examples = [
|
| 87 |
+
"What is a thesis statement and how do I write one?",
|
| 88 |
+
"What should I include in my introduction paragraph?",
|
| 89 |
+
"How can I end my essay?"
|
| 90 |
+
]
|
| 91 |
)
|
| 92 |
# chatbot = gr.ChatInterface(respond, type="messages")
|
| 93 |
|