Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -61,6 +61,8 @@ You are a helpful, respectful and honest assistant. Always answer as helpfully a
|
|
61 |
|
62 |
code = """
|
63 |
```python
|
|
|
|
|
64 |
SYSTEM_PROMPT = "You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information."
|
65 |
PROMPT = "{PROMPT}"
|
66 |
MODEL_NAME = "meta-llama/Meta-Llama-3-70b-Instruct" # or "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO" or "HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1"
|
@@ -72,7 +74,7 @@ messages = [
|
|
72 |
client = InferenceClient(model=MODEL_NAME, token=HF_TOKEN)
|
73 |
for c in client.chat_completion(messages, max_tokens=200, stream=True):
|
74 |
token = c.choices[0].delta.content
|
75 |
-
print(token)
|
76 |
```
|
77 |
"""
|
78 |
|
|
|
61 |
|
62 |
code = """
|
63 |
```python
|
64 |
+
from huggingface_hub import InferenceClient
|
65 |
+
|
66 |
SYSTEM_PROMPT = "You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information."
|
67 |
PROMPT = "{PROMPT}"
|
68 |
MODEL_NAME = "meta-llama/Meta-Llama-3-70b-Instruct" # or "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO" or "HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1"
|
|
|
74 |
client = InferenceClient(model=MODEL_NAME, token=HF_TOKEN)
|
75 |
for c in client.chat_completion(messages, max_tokens=200, stream=True):
|
76 |
token = c.choices[0].delta.content
|
77 |
+
print(token, end="")
|
78 |
```
|
79 |
"""
|
80 |
|