Views
No views yet
trust_remote_code required1from transformers import pipeline
2import torch
3
4device = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
5
6pipe = pipeline('text-generation', model='mrfakename/Apriel-5B-Instruct-llamafied', device=device)
7
8print(pipe(pipe.tokenizer.apply_chat_template([{'role': 'user', 'content': 'Hello'}], tokenize=False, add_generation_prompt=True))[0]['generated_text'])