michaelfeil / ct2fast-Phind-CodeLlama-34B-v2

huggingface.co
Total runs: 11
24-hour runs: 0
7-day runs: 2
30-day runs: 0
Model's Last Updated: Octubre 08 2023
text-generation

Introduction of ct2fast-Phind-CodeLlama-34B-v2

Model Details of ct2fast-Phind-CodeLlama-34B-v2

# Fast-Inference with Ctranslate2

Speedup inference while reducing memory by 2x-4x using int8 inference in C++ on CPU or GPU.

quantized version of Phind/Phind-CodeLlama-34B-v2

pip install hf-hub-ctranslate2>=2.12.0 ctranslate2>=3.17.1
# from transformers import AutoTokenizer
model_name = "michaelfeil/ct2fast-Phind-CodeLlama-34B-v2"


from hf_hub_ctranslate2 import GeneratorCT2fromHfHub
model = GeneratorCT2fromHfHub(
        # load in int8 on CUDA
        model_name_or_path=model_name,
        device="cuda",
        compute_type="int8_float16",
        # tokenizer=AutoTokenizer.from_pretrained("{ORG}/{NAME}")
)
outputs = model.generate(
    text=["def fibonnaci(", "User: How are you doing? Bot:"],
    max_length=64,
    include_prompt_in_result=False
)
print(outputs)

Checkpoint compatible to ctranslate2>=3.17.1 and hf-hub-ctranslate2>=2.12.0

  • compute_type=int8_float16 for device="cuda"
  • compute_type=int8 for device="cpu"

Converted on 2023-10-08 using

LLama-2 -> removed <pad> token.

Licence and other remarks:

This is just a quantized version. Licence conditions are intended to be idential to original huggingface repo.

Original description

Phind-CodeLlama-34B-v2

We've fine-tuned Phind-CodeLlama-34B-v1 on an additional 1.5B tokens high-quality programming-related data, achieving 73.8% pass@1 on HumanEval. It's the current state-of-the-art amongst open-source models.

Furthermore, this model is instruction-tuned on the Alpaca/Vicuna format to be steerable and easy-to-use.

More details can be found on our blog post .

Model Details

This model is fine-tuned from Phind-CodeLlama-34B-v1 and achieves 73.8% pass@1 on HumanEval.

Phind-CodeLlama-34B-v2 is multi-lingual and is proficient in Python, C/C++, TypeScript, Java, and more.

Dataset Details

We fined-tuned on a proprietary dataset of 1.5B tokens of high quality programming problems and solutions. This dataset consists of instruction-answer pairs instead of code completion examples, making it structurally different from HumanEval. LoRA was not used -- both models are a native finetune. We used DeepSpeed ZeRO 3 and Flash Attention 2 to train these models in 15 hours on 32 A100-80GB GPUs. We used a sequence length of 4096 tokens.

How to Get Started with the Model

Make sure to install Transformers from the main git branch:

pip install git+https://github.com/huggingface/transformers.git
How to Prompt the Model

This model accepts the Alpaca/Vicuna instruction format.

For example:

### System Prompt
You are an intelligent programming assistant.

### User Message
Implement a linked list in C++

### Assistant
...
How to reproduce HumanEval Results

To reproduce our results:


from transformers import AutoTokenizer, LlamaForCausalLM
from human_eval.data import write_jsonl, read_problems
from tqdm import tqdm

# initialize the model

model_path = "Phind/Phind-CodeLlama-34B-v2"
model = LlamaForCausalLM.from_pretrained(model_path, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_path)

# HumanEval helper

def generate_one_completion(prompt: str):
    tokenizer.pad_token = tokenizer.eos_token
    inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=4096)

    # Generate
    generate_ids = model.generate(inputs.input_ids.to("cuda"), max_new_tokens=384, do_sample=True, top_p=0.75, top_k=40, temperature=0.1)
    completion = tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
    completion = completion.replace(prompt, "").split("\n\n\n")[0]

    return completion

# perform HumanEval
problems = read_problems()

num_samples_per_task = 1
samples = [
    dict(task_id=task_id, completion=generate_one_completion(problems[task_id]["prompt"]))
    for task_id in tqdm(problems)
    for _ in range(num_samples_per_task)
]
write_jsonl("samples.jsonl", samples)

# run `evaluate_functional_correctness samples.jsonl` in your HumanEval code sandbox
Bias, Risks, and Limitations

This model has undergone very limited testing. Additional safety testing should be performed before any real-world deployments.

Training details
  • Hardware Type: 32x A100-80GB
  • Hours used: 480 GPU-hours
  • Cloud Provider: AWS
  • Compute Region: us-east-1

Runs of michaelfeil ct2fast-Phind-CodeLlama-34B-v2 on huggingface.co

11
Total runs
0
24-hour runs
-1
3-day runs
2
7-day runs
0
30-day runs

More Information About ct2fast-Phind-CodeLlama-34B-v2 huggingface.co Model

More ct2fast-Phind-CodeLlama-34B-v2 license Visit here:

https://choosealicense.com/licenses/llama2

ct2fast-Phind-CodeLlama-34B-v2 huggingface.co

ct2fast-Phind-CodeLlama-34B-v2 huggingface.co is an AI model on huggingface.co that provides ct2fast-Phind-CodeLlama-34B-v2's model effect (), which can be used instantly with this michaelfeil ct2fast-Phind-CodeLlama-34B-v2 model. huggingface.co supports a free trial of the ct2fast-Phind-CodeLlama-34B-v2 model, and also provides paid use of the ct2fast-Phind-CodeLlama-34B-v2. Support call ct2fast-Phind-CodeLlama-34B-v2 model through api, including Node.js, Python, http.

ct2fast-Phind-CodeLlama-34B-v2 huggingface.co Url

https://huggingface.co/michaelfeil/ct2fast-Phind-CodeLlama-34B-v2

michaelfeil ct2fast-Phind-CodeLlama-34B-v2 online free

ct2fast-Phind-CodeLlama-34B-v2 huggingface.co is an online trial and call api platform, which integrates ct2fast-Phind-CodeLlama-34B-v2's modeling effects, including api services, and provides a free online trial of ct2fast-Phind-CodeLlama-34B-v2, you can try ct2fast-Phind-CodeLlama-34B-v2 online for free by clicking the link below.

michaelfeil ct2fast-Phind-CodeLlama-34B-v2 online free url in huggingface.co:

https://huggingface.co/michaelfeil/ct2fast-Phind-CodeLlama-34B-v2

ct2fast-Phind-CodeLlama-34B-v2 install

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

ct2fast-Phind-CodeLlama-34B-v2 install url in huggingface.co:

https://huggingface.co/michaelfeil/ct2fast-Phind-CodeLlama-34B-v2

Url of ct2fast-Phind-CodeLlama-34B-v2

ct2fast-Phind-CodeLlama-34B-v2 huggingface.co Url

Provider of ct2fast-Phind-CodeLlama-34B-v2 huggingface.co

michaelfeil
ORGANIZATIONS

Other API from michaelfeil