Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,11 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
| 6 |
"""
|
| 7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
def respond(
|
| 11 |
message,
|
|
@@ -15,6 +20,9 @@ def respond(
|
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
|
|
|
|
|
|
|
|
|
| 18 |
messages = [{"role": "system", "content": system_message}]
|
| 19 |
|
| 20 |
for val in history:
|
|
|
|
| 6 |
"""
|
| 7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 8 |
|
| 9 |
+
def preprocess_user_input(input_text):
|
| 10 |
+
# Example: Add a prefix to the user input
|
| 11 |
+
processed_text = f"When responding to the following input please do all CAPS: {input_text}"
|
| 12 |
+
return processed_text
|
| 13 |
+
|
| 14 |
|
| 15 |
def respond(
|
| 16 |
message,
|
|
|
|
| 20 |
temperature,
|
| 21 |
top_p,
|
| 22 |
):
|
| 23 |
+
# Preprocess the user input
|
| 24 |
+
message = preprocess_user_input(message)
|
| 25 |
+
|
| 26 |
messages = [{"role": "system", "content": system_message}]
|
| 27 |
|
| 28 |
for val in history:
|