Views
No views yet
HuggingFaceTB/SmolLM2-360M.1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4model_id = "srmty/smolLM2-360M-math-instruct"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7
8model = AutoModelForCausalLM.from_pretrained(
9 model_id,
10 torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
11 device_map="auto" if torch.cuda.is_available() else None,
12)
13
14if tokenizer.pad_token is None:
15 tokenizer.pad_token = tokenizer.eos_token
16
17model.eval()
18teknium/GPTeacher-General-Instructmeta-math/MetaMathQA subset1Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
2
3### Instruction:
4{instruction}
5
6### Input:
7{input}
8
9### Response: