mrm8488 / llama-2-coder-7b

huggingface.co
Total runs: 84
24-hour runs: -2
7-day runs: 3
30-day runs: 29
Model's Last Updated: December 24 2023
text-generation

Introduction of llama-2-coder-7b

Model Details of llama-2-coder-7b

llama-2 coder logo

LlaMa 2 Coder 🦙👩‍💻

LlaMa-2 7b fine-tuned on the CodeAlpaca 20k instructions dataset by using the method QLoRA with PEFT library.

Model description 🧠

Llama-2

Llama 2 is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. Meta developed and publicly released the Llama 2 family of large language models (LLMs), a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. Our fine-tuned LLMs, called Llama-2-Chat, are optimized for dialogue use cases. Llama-2-Chat models outperform open-source chat models on most benchmarks we tested, and in our human evaluations for helpfulness and safety, are on par with some popular closed-source models like ChatGPT and PaLM.

Training and evaluation data 📚

CodeAlpaca_20K : contains 20K instruction-following data used for fine-tuning the Code Alpaca model.

Training hyperparameters ⚙
    optim="paged_adamw_32bit",
    num_train_epochs = 2,
    eval_steps=50,
    save_steps=50,
    evaluation_strategy="steps",
    save_strategy="steps",
    save_total_limit=2,
    seed=66,
    load_best_model_at_end=True,
    logging_steps=1,
    learning_rate=2e-4,
    fp16=True,
    bf16=False,
    max_grad_norm=0.3,
    warmup_ratio=0.03,
    group_by_length=True,
    lr_scheduler_type="constant"
Training results 🗒️
Step Training Loss Validation Loss
50 0.624400 0.600070
100 0.634100 0.592757
150 0.545800 0.586652
200 0.572500 0.577525
250 0.528000 0.590118
Eval results 📊

WIP

Example of usage 👩‍💻
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig

model_id = "mrm8488/llama-2-coder-7b"

tokenizer = AutoTokenizer.from_pretrained(model_id)

model = AutoModelForCausalLM.from_pretrained(model_id).to("cuda")

def create_prompt(instruction):
  system = "You are a coding assistant that will help the user to resolve the following instruction:"
  instruction = "### Instruction: " + instruction
  return system + "\n" + instruction + "\n\n" + "### Solution:" + "\n"

def generate(
        instruction,
        max_new_tokens=128,
        temperature=0.1,
        top_p=0.75,
        top_k=40,
        num_beams=4,
        **kwargs,
):
    prompt = create_prompt(instruction)
    print(prompt)
    inputs = tokenizer(prompt, return_tensors="pt")
    input_ids = inputs["input_ids"].to("cuda")
    attention_mask = inputs["attention_mask"].to("cuda")
    generation_config = GenerationConfig(
        temperature=temperature,
        top_p=top_p,
        top_k=top_k,
        num_beams=num_beams,
        **kwargs,
    )
    with torch.no_grad():
        generation_output = model.generate(
            input_ids=input_ids,
            attention_mask=attention_mask,
            generation_config=generation_config,
            return_dict_in_generate=True,
            output_scores=True,
            max_new_tokens=max_new_tokens,
            early_stopping=True
        )
    s = generation_output.sequences[0]
    output = tokenizer.decode(s)
    return output.split("### Solution:")[1].lstrip("\n")

instruction = """
Edit the following XML code to add a navigation bar to the top of a web page
<html>
<head>
  <title>CliBrAIn</title>
</head>
"""
print(generate(instruction))
Citation
@misc {manuel_romero_2023,
    author       = { {Manuel Romero} },
    title        = { llama-2-coder-7b (Revision d30d193) },
    year         = 2023,
    url          = { https://huggingface.co/mrm8488/llama-2-coder-7b },
    doi          = { 10.57967/hf/0931 },
    publisher    = { Hugging Face }
}

Runs of mrm8488 llama-2-coder-7b on huggingface.co

84
Total runs
-2
24-hour runs
0
3-day runs
3
7-day runs
29
30-day runs

More Information About llama-2-coder-7b huggingface.co Model

More llama-2-coder-7b license Visit here:

https://choosealicense.com/licenses/apache-2.0

llama-2-coder-7b huggingface.co

llama-2-coder-7b huggingface.co is an AI model on huggingface.co that provides llama-2-coder-7b's model effect (), which can be used instantly with this mrm8488 llama-2-coder-7b model. huggingface.co supports a free trial of the llama-2-coder-7b model, and also provides paid use of the llama-2-coder-7b. Support call llama-2-coder-7b model through api, including Node.js, Python, http.

llama-2-coder-7b huggingface.co Url

https://huggingface.co/mrm8488/llama-2-coder-7b

mrm8488 llama-2-coder-7b online free

llama-2-coder-7b huggingface.co is an online trial and call api platform, which integrates llama-2-coder-7b's modeling effects, including api services, and provides a free online trial of llama-2-coder-7b, you can try llama-2-coder-7b online for free by clicking the link below.

mrm8488 llama-2-coder-7b online free url in huggingface.co:

https://huggingface.co/mrm8488/llama-2-coder-7b

llama-2-coder-7b install

llama-2-coder-7b is an open source model from GitHub that offers a free installation service, and any user can find llama-2-coder-7b on GitHub to install. At the same time, huggingface.co provides the effect of llama-2-coder-7b install, users can directly use llama-2-coder-7b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

llama-2-coder-7b install url in huggingface.co:

https://huggingface.co/mrm8488/llama-2-coder-7b

Url of llama-2-coder-7b

llama-2-coder-7b huggingface.co Url

Provider of llama-2-coder-7b huggingface.co

mrm8488
ORGANIZATIONS

Other API from mrm8488

huggingface.co

Total runs: 855
Run Growth: 264
Growth Rate: 30.88%
Updated:February 23 2024
huggingface.co

Total runs: 317
Run Growth: 173
Growth Rate: 54.57%
Updated:March 19 2023
huggingface.co

Total runs: 90
Run Growth: 70
Growth Rate: 77.78%
Updated:June 20 2023
huggingface.co

Total runs: 72
Run Growth: 32
Growth Rate: 44.44%
Updated:January 24 2024