ariG23498 HF Staff commited on
Commit
3423449
·
verified ·
1 Parent(s): 0f14f45

Upload deepseek-ai_DeepSeek-R1-0528_1.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. deepseek-ai_DeepSeek-R1-0528_1.py +2 -2
deepseek-ai_DeepSeek-R1-0528_1.py CHANGED
@@ -15,7 +15,7 @@ try:
15
  messages = [
16
  {"role": "user", "content": "Who are you?"},
17
  ]
18
- inputs = ${processorVarName}.apply_chat_template(
19
  messages,
20
  add_generation_prompt=True,
21
  tokenize=True,
@@ -24,7 +24,7 @@ try:
24
  ).to(model.device)
25
 
26
  outputs = model.generate(**inputs, max_new_tokens=40)
27
- print(${processorVarName}.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
28
  with open('deepseek-ai_DeepSeek-R1-0528_1.txt', 'w') as f:
29
  f.write('Everything was good in deepseek-ai_DeepSeek-R1-0528_1.txt')
30
  except Exception as e:
 
15
  messages = [
16
  {"role": "user", "content": "Who are you?"},
17
  ]
18
+ inputs = tokenizer.apply_chat_template(
19
  messages,
20
  add_generation_prompt=True,
21
  tokenize=True,
 
24
  ).to(model.device)
25
 
26
  outputs = model.generate(**inputs, max_new_tokens=40)
27
+ print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
28
  with open('deepseek-ai_DeepSeek-R1-0528_1.txt', 'w') as f:
29
  f.write('Everything was good in deepseek-ai_DeepSeek-R1-0528_1.txt')
30
  except Exception as e: