psynote123 commited on
Commit
e5a55b2
·
verified ·
1 Parent(s): 8df34ce

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +16 -2
README.md CHANGED
@@ -64,8 +64,22 @@ model = AutoModelForCausalLM.from_pretrained(
64
  model.generation_config.pad_token_id = tokenizer.eos_token_id
65
 
66
  # Inference simple as transformers library
67
- prompt = "Describe basics of DNNs quantization."
68
- inputs = tokenizer(prompt, return_tensors="pt")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  inputs.to(device)
70
 
71
  with torch.inference_mode:
 
64
  model.generation_config.pad_token_id = tokenizer.eos_token_id
65
 
66
  # Inference simple as transformers library
67
+ messages = [
68
+ {
69
+ "role": "system",
70
+ "content": "You are a search bot, answer on user text queries."
71
+ },
72
+ {
73
+ "role": "user",
74
+ "content": "Describe basics of DNNs quantization."
75
+ }
76
+ ]
77
+
78
+ chat_prompt = tokenizer.apply_chat_template(
79
+ messages, add_generation_prompt=True, tokenize=False
80
+ )
81
+
82
+ inputs = tokenizer(chat_prompt, return_tensors="pt")
83
  inputs.to(device)
84
 
85
  with torch.inference_mode: