Tonic commited on
Commit
2b24dd8
·
1 Parent(s): fe35217

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -15,15 +15,15 @@ model_name = "allenai/tulu-2-dpo-13b"
15
  tokenizer = AutoTokenizer.from_pretrained("allenai/tulu-2-dpo-13b")
16
  model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
17
 
18
- bos_token_id = 1
19
- eos_token_id = 2
20
- tokenizer.bos_token_id = bos_token_id
21
- tokenizer.eos_token_id = eos_token_id
22
- model.config.bos_token_id = bos_token_id
23
- model.config.eos_token_id = eos_token_id
24
- if tokenizer.pad_token is None:
25
- tokenizer.pad_token = tokenizer.eos_token
26
- model.config.pad_token_id = tokenizer.convert_tokens_to_ids(tokenizer.pad_token)
27
 
28
  class TuluChatBot:
29
  def __init__(self, model, tokenizer, system_message="You are 🌷Tulu, an AI language model created by Tonic-AI. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior."):
@@ -86,7 +86,7 @@ with gr.Blocks(theme = "ParityError/Anime") as demo:
86
  system_message = gr.Textbox(label="Optional 🌷Tulu Assistant Message", lines=2)
87
  user_message = gr.Textbox(label="Your Message", lines=3)
88
  with gr.Row():
89
- do_sample = gr.Checkbox(label="Advanced", value=False)
90
 
91
  with gr.Accordion("Advanced Settings", open=lambda do_sample: do_sample):
92
  with gr.Row():
 
15
  tokenizer = AutoTokenizer.from_pretrained("allenai/tulu-2-dpo-13b")
16
  model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
17
 
18
+ # bos_token_id = 1
19
+ # eos_token_id = 2
20
+ # tokenizer.bos_token_id = bos_token_id
21
+ # tokenizer.eos_token_id = eos_token_id
22
+ # model.config.bos_token_id = bos_token_id
23
+ # model.config.eos_token_id = eos_token_id
24
+ # if tokenizer.pad_token is None:
25
+ # tokenizer.pad_token = tokenizer.eos_token
26
+ # model.config.pad_token_id = tokenizer.convert_tokens_to_ids(tokenizer.pad_token)
27
 
28
  class TuluChatBot:
29
  def __init__(self, model, tokenizer, system_message="You are 🌷Tulu, an AI language model created by Tonic-AI. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior."):
 
86
  system_message = gr.Textbox(label="Optional 🌷Tulu Assistant Message", lines=2)
87
  user_message = gr.Textbox(label="Your Message", lines=3)
88
  with gr.Row():
89
+ do_sample = gr.Checkbox(label="Advanced", value=True)
90
 
91
  with gr.Accordion("Advanced Settings", open=lambda do_sample: do_sample):
92
  with gr.Row():