Views
No views yet
HuggingFaceTB/SmolLM2-360M.1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4model_id = "srmty/smolLM_360M_Base_it"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id, subfolder="final")
7
8model = AutoModelForCausalLM.from_pretrained(
9 model_id,
10 subfolder="final",
11 torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
12 device_map="auto" if torch.cuda.is_available() else None,
13)
14
15if tokenizer.pad_token is None:
16 tokenizer.pad_token = tokenizer.eos_token
17
18model.eval()
19teknium/GPTeacher-General-Instruct1Below 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: