This model is a fine-tuned version of
bigcode/tiny_starcoder_py using a samples from
iamtarun/python_code_instructions_18k_alpaca dataset.
It has been trained using
TRL.
1model_name = "sky-2002/tiny-starcoder-ft"
2model = AutoModelForCausalLM.from_pretrained(
3 pretrained_model_name_or_path=model_name
4).to(device)
5tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path=model_name)
6
7prompt = "Write python code to calculate sum of a list"
8
9# Format with template
10messages = [{"role": "user", "content": prompt}]
11formatted_prompt = tokenizer.apply_chat_template(messages, tokenize=False)
12
13inputs = tokenizer(formatted_prompt, return_tensors="pt").to(device)
14
15outputs = model.generate(**inputs, max_new_tokens=100)
16print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model was trained with SFT.
1@misc{vonwerra2022trl,
2 title = {{TRL: Transformer Reinforcement Learning}},
3 author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}