Downloads · 30 days
0
crumb/GeoV-Instruct-LoRA
GeoV-Instruct-LoRA is a machine learning model from crumb. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Apr 6, 2023
Repo size
42 MB
Likes
1
Public
Click a slice to open those files.
.bin42 MB · 100%
From the Hugging Face model README
Prompt Format:
[instruction]
[optional input]
[response will start after two newlines]
!pip install -q bitsandbytes datasets accelerate loralib
!pip install -q git+https://github.com/huggingface/transformers.git@main git+https://github.com/huggingface/peft.git
!pip install -q geov
import torch
from peft import PeftModel, PeftConfig
from geov import GeoVForCausalLM, GeoVTokenizer
model = GeoVForCausalLM.from_pretrained(
"GeoV/GeoV-9b",
load_in_8bit=True,
low_cpu_mem_usage=True,
device_map='auto',
)
tokenizer = GeoVTokenizer.from_pretrained("GeoV/GeoV-9b")
peft_model_id = "crumb/GeoV-Instruct-LoRA"
model = PeftModel.from_pretrained(model, peft_model_id)
# Inference
prompt = '''
Describe the structure of an atom.
'''
batch = tokenizer(prompt, return_tensors='pt')
with torch.cuda.amp.autocast():
output_tokens = model.generate(**batch, max_new_tokens=50)
print(tokenizer.decode(output_tokens[0], skip_special_tokens=True))