Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,14 +5,14 @@ from transformers import AutoTokenizer
|
|
| 5 |
from mySystemPrompt import SYSTEM_PROMPT
|
| 6 |
|
| 7 |
# Model which is used
|
| 8 |
-
checkpoint = "
|
| 9 |
# Inference client with the model (And HF-token if needed)
|
| 10 |
client = InferenceClient(checkpoint)
|
| 11 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
| 12 |
# Tokenizer chat template correction(Only works for mistral models)
|
| 13 |
-
chat_template = open("mistral-instruct.jinja").read()
|
| 14 |
-
chat_template = chat_template.replace(' ', '').replace('\n', '')
|
| 15 |
-
tokenizer.chat_template = chat_template
|
| 16 |
|
| 17 |
def format_prompt(message,chatbot,system_prompt):
|
| 18 |
messages = [{"role": "system","content": system_prompt}]
|
|
@@ -126,7 +126,7 @@ gr.ChatInterface(
|
|
| 126 |
inference,
|
| 127 |
chatbot=myChatbot,
|
| 128 |
textbox=myTextInput,
|
| 129 |
-
title="FRANZI-Bot",
|
| 130 |
theme=myTheme,
|
| 131 |
#additional_inputs=myAdditionalInputs,
|
| 132 |
submit_btn=mySubmitButton,
|
|
|
|
| 5 |
from mySystemPrompt import SYSTEM_PROMPT
|
| 6 |
|
| 7 |
# Model which is used
|
| 8 |
+
checkpoint = "CohereForAI/c4ai-command-r-plus"
|
| 9 |
# Inference client with the model (And HF-token if needed)
|
| 10 |
client = InferenceClient(checkpoint)
|
| 11 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
| 12 |
# Tokenizer chat template correction(Only works for mistral models)
|
| 13 |
+
#chat_template = open("mistral-instruct.jinja").read()
|
| 14 |
+
#chat_template = chat_template.replace(' ', '').replace('\n', '')
|
| 15 |
+
#tokenizer.chat_template = chat_template
|
| 16 |
|
| 17 |
def format_prompt(message,chatbot,system_prompt):
|
| 18 |
messages = [{"role": "system","content": system_prompt}]
|
|
|
|
| 126 |
inference,
|
| 127 |
chatbot=myChatbot,
|
| 128 |
textbox=myTextInput,
|
| 129 |
+
title="FRANZI-Bot 2.0",
|
| 130 |
theme=myTheme,
|
| 131 |
#additional_inputs=myAdditionalInputs,
|
| 132 |
submit_btn=mySubmitButton,
|