Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4base = "Qwen/Qwen2.5-VL-7B-Instruct"
5adapter = "Ewengc21/qwen_qlora_dl_project"
6
7tokenizer = AutoTokenizer.from_pretrained(base, trust_remote_code=True)
8model = AutoModelForCausalLM.from_pretrained(
9 base,
10 device_map="auto",
11 trust_remote_code=True
12)
13model = PeftModel.from_pretrained(model, adapter)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{\'e}dec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}