Spaces:
Sleeping
Sleeping
ww commited on
Commit ·
8bcebd6
1
Parent(s): a0b6257
tuoe
Browse files
app.py
CHANGED
|
@@ -9,9 +9,6 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
| 9 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1",token=os.getenv('HUGGINGFACE_TOKEN').strip())
|
| 10 |
|
| 11 |
def format_prompt(message, history):
|
| 12 |
-
print('==========format prompt===========')
|
| 13 |
-
print(history)
|
| 14 |
-
print('=====================')
|
| 15 |
prompt = "<s>"
|
| 16 |
for user_prompt, bot_response in history:
|
| 17 |
prompt += f"[INST] {user_prompt} [/INST]"
|
|
@@ -28,6 +25,7 @@ def generate_response(
|
|
| 28 |
top_p,
|
| 29 |
):
|
| 30 |
print('=====================')
|
|
|
|
| 31 |
jsonObject = ""
|
| 32 |
try:
|
| 33 |
jsonObject = json.loads(system_prompt)
|
|
|
|
| 9 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1",token=os.getenv('HUGGINGFACE_TOKEN').strip())
|
| 10 |
|
| 11 |
def format_prompt(message, history):
|
|
|
|
|
|
|
|
|
|
| 12 |
prompt = "<s>"
|
| 13 |
for user_prompt, bot_response in history:
|
| 14 |
prompt += f"[INST] {user_prompt} [/INST]"
|
|
|
|
| 25 |
top_p,
|
| 26 |
):
|
| 27 |
print('=====================')
|
| 28 |
+
print(type(history))
|
| 29 |
jsonObject = ""
|
| 30 |
try:
|
| 31 |
jsonObject = json.loads(system_prompt)
|