Views
No views yet
Where Code Meets Beekeeping: An Unbeelievable Synergy!
phi-1bee5, a groundbreaking transformer model that's here to disrupt your apiary and your IDE!BEE-spoke-data/bees-internal dataset.1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3# !pip install -U -q transformers accelerate einops
4
5checkpoint = "BEE-spoke-data/phi-1bee5"
6tokenizer = AutoTokenizer.from_pretrained(checkpoint)
7model = AutoModelForCausalLM.from_pretrained(
8 checkpoint,
9 device_map="auto",
10 torch_dtype=torch.float16,
11 trust_remote_code=True
12)1prompt = "Today was an amazing day because"
2inputs = tokenizer(prompt, return_tensors="pt", return_attention_mask=False).to(
3 model.device
4)
5
6outputs = model.generate(
7 **inputs, do_sample=True, max_new_tokens=128, epsilon_cutoff=7e-4
8)
9result = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
10print(result)
11# output will probably contain a story/info about bees