Zenithwang commited on
Commit
0298010
1 Parent(s): bf14f3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -25,8 +25,8 @@ class StopOnTokens(StoppingCriteria):
25
 
26
 
27
  system_role= 'system'
28
- user_role = 'question'
29
- assistant_role = "answer"
30
 
31
  sft_start_token = "<|im_start|>"
32
  sft_end_token = "<|im_end|>"
@@ -59,7 +59,7 @@ def predict(message, history):
59
 
60
  print(f'model_messages: {model_messages}')
61
 
62
- print(f'model_final_inputs: {tokenizer.apply_chat_template(model_messages, add_generation_prompt=True, tokenize=False)}, flash=True')
63
  model_inputs = tokenizer.apply_chat_template(model_messages, add_generation_prompt=True, return_tensors="pt").to(device)
64
  # model_inputs = tokenizer([messages], return_tensors="pt").to(device)
65
 
@@ -102,7 +102,7 @@ placeholder = """
102
  </div>
103
  """
104
 
105
- chatbot = gr.Chatbot(label='Sailor', placeholder=None)
106
  with gr.Blocks(theme=gr.themes.Soft(), fill_height=True) as demo:
107
  # gr.Markdown("""<center><font size=8>Sailor-Chat Bot⚓</center>""")
108
  gr.Markdown("""<p align="center"><img src="https://github.com/sail-sg/sailor-llm/raw/main/misc/wide_sailor_banner.jpg" style="height: 110px"/><p>""")
 
25
 
26
 
27
  system_role= 'system'
28
+ user_role = 'user'
29
+ assistant_role = "assistant"
30
 
31
  sft_start_token = "<|im_start|>"
32
  sft_end_token = "<|im_end|>"
 
59
 
60
  print(f'model_messages: {model_messages}')
61
 
62
+ print(f'model_final_inputs: {tokenizer.apply_chat_template(model_messages, add_generation_prompt=True, tokenize=False)}', flash=True)
63
  model_inputs = tokenizer.apply_chat_template(model_messages, add_generation_prompt=True, return_tensors="pt").to(device)
64
  # model_inputs = tokenizer([messages], return_tensors="pt").to(device)
65
 
 
102
  </div>
103
  """
104
 
105
+ chatbot = gr.Chatbot(label='OpenCoder', placeholder=None)
106
  with gr.Blocks(theme=gr.themes.Soft(), fill_height=True) as demo:
107
  # gr.Markdown("""<center><font size=8>Sailor-Chat Bot⚓</center>""")
108
  gr.Markdown("""<p align="center"><img src="https://github.com/sail-sg/sailor-llm/raw/main/misc/wide_sailor_banner.jpg" style="height: 110px"/><p>""")