Views
No views yet
Oh, I just saw the best meme - have you seen it?Hahahaha, I had no idea! I'm always looking for something interesting, creative, or funny.
Remember, that's the best kind of meme. Keep it creative and poke fun, and you might just stumble upon an amazing idea or a delightful little thing.1device = torch.device("cuda")
2PPO_REPO_NAME = f"MurDanya/llm-course-hw2-ppo"
3
4tokenizer = AutoTokenizer.from_pretrained(PPO_REPO_NAME)
5check_model = AutoModelForCausalLM.from_pretrained(PPO_REPO_NAME)
6check_model = check_model.to(device)
7check_model = check_model.eval()
8
9messages = [{"role": "user", "content": "Oh, I just saw the best meme - have you seen it?"}]
10
11text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
12model_inputs = tokenizer([text], return_tensors="pt").to(device)
13
14generated_ids = check_model.generate(model_inputs.input_ids, max_new_tokens=256, do_sample=False)
15response = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
16
17print(response)