Downloads · 30 days
12
6% of all-time downloads
hynky/codellama-7b-sft-lora-func-names-java-4bit
codellama-7b-sft-lora-func-names-java-4bit is a machine learning model from hynky. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
- Developed by: [More Information Needed] - Funded by [optional]: [More Information Needed] - Shared by [optional]: [More Information Needed] - Model type: [More Information Needed] - Language(s) (NLP): [More Informat…
Downloads · 30 days
12
6% of all-time downloads
All-time downloads
200
Public
Repo size
1.3 GB
Likes
0
Public
Click a slice to open those files.
.safetensors1.3 GB · 100%
From the Hugging Face model README
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer
config = PeftConfig.from_pretrained("hynky/codellama-7b-sft-lora-func-names-java-4bit")
model = AutoModelForCausalLM.from_pretrained("codellama/CodeLlama-7b-hf",
torch_dtype='auto',
device_map='auto',
offload_folder="offload",
offload_state_dict = True)
model = PeftModel.from_pretrained(model, "hynky/codellama-7b-sft-lora-func-names-java-4bit")
def generate_code(sample, max_new_tokens=200):
batch = tokenizer(sample, return_tensors='pt').to(device)
with torch.cuda.amp.autocast():
output_tokens = model.generate(**batch, max_new_tokens=max_new_tokens)
return tokenizer.decode(output_tokens[0], skip_special_tokens=True)
print(generate_code("public class AddTwoIntegers("))
[More Information Needed]
[More Information Needed]
[More Information Needed]
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
Use the code below to get started with the model.
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]