Ctaake commited on
Commit
6d0e872
·
verified ·
1 Parent(s): d60afe0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 = "mistralai/Mistral-7B-Instruct-v0.2"
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,