Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from huggingface_hub import InferenceClient
|
|
| 4 |
"""
|
| 5 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 6 |
"""
|
| 7 |
-
client = InferenceClient("
|
| 8 |
|
| 9 |
|
| 10 |
def respond(
|
|
@@ -15,15 +15,15 @@ def respond(
|
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
| 18 |
-
messages = [{"role": "
|
| 19 |
|
| 20 |
for val in history:
|
| 21 |
if val[0]:
|
| 22 |
-
messages.append({"role": "
|
| 23 |
if val[1]:
|
| 24 |
-
messages.append({"role": "
|
| 25 |
|
| 26 |
-
messages.append({"role": "
|
| 27 |
|
| 28 |
response = ""
|
| 29 |
|
|
|
|
| 4 |
"""
|
| 5 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 6 |
"""
|
| 7 |
+
client = InferenceClient("csr/customer-service-chat-responses")
|
| 8 |
|
| 9 |
|
| 10 |
def respond(
|
|
|
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
| 18 |
+
messages = [{"role": "Assistant", "content": system_message}]
|
| 19 |
|
| 20 |
for val in history:
|
| 21 |
if val[0]:
|
| 22 |
+
messages.append({"role": "Human", "content": val[0]})
|
| 23 |
if val[1]:
|
| 24 |
+
messages.append({"role": "Assistant", "content": val[1]})
|
| 25 |
|
| 26 |
+
messages.append({"role": "Human", "content": message})
|
| 27 |
|
| 28 |
response = ""
|
| 29 |
|