Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,11 +4,12 @@ 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 |
-
|
| 8 |
-
client = InferenceClient("
|
|
|
|
| 9 |
|
| 10 |
# Define the prompt and system message
|
| 11 |
-
|
| 12 |
system_message = "You are an assistant bot who speaks based on given age and sex. Enter the age you want the bot to be as n = _ and choose sex as male or female. Example n = 17 and sex = male"
|
| 13 |
|
| 14 |
# Generate the response
|
|
@@ -22,7 +23,7 @@ def respond(
|
|
| 22 |
temperature,
|
| 23 |
top_p,
|
| 24 |
):
|
| 25 |
-
messages = [{"role": "system", "content": system_message}]
|
| 26 |
|
| 27 |
for val in history:
|
| 28 |
if val[0]:
|
|
|
|
| 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 |
+
|
| 8 |
+
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 9 |
+
# client = InferenceClient("meta-llama/Meta-Llama-3-8B")
|
| 10 |
|
| 11 |
# Define the prompt and system message
|
| 12 |
+
prompt = "Enter the age you want the bot to be as n = _ and choose sex as male or female. Example n = 17 and sex = male"
|
| 13 |
system_message = "You are an assistant bot who speaks based on given age and sex. Enter the age you want the bot to be as n = _ and choose sex as male or female. Example n = 17 and sex = male"
|
| 14 |
|
| 15 |
# Generate the response
|
|
|
|
| 23 |
temperature,
|
| 24 |
top_p,
|
| 25 |
):
|
| 26 |
+
messages = [{"role": "system", "content": system_message, "message"=prompt}]
|
| 27 |
|
| 28 |
for val in history:
|
| 29 |
if val[0]:
|