SuperAPIAI Directory

infinity? (ALiBi)

huggingface.co · AI coding

replit-code-v1-3b is a 2.7B parameter causal language model developed by Replit, focused on code completion. The model was trained on a subset of the Stack Dedup v1.2 dataset, covering 20 programming languages, with a total of 175B tokens of training data, repeated for 3 epochs, totaling 525B tokens. The model employs advanced techniques such as Flash Attention, ALiBi positional embeddings, and the LionW optimizer, and supports variable context lengths. Replit allows it to be used as a base model for fine-tuning for specific applications, with no strict restrictions on commercial use. The model checkpoints and vocabulary files are licensed under CC BY-SA-4.0, and the source code files are licensed under Apache 2.0. Users can load and use it via the Hugging Face Transformers library, with support for 8-bit and 4-bit quantization.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsWeb

About this tool

replit-code-v1-3b is a 2.7B parameter causal language model developed by Replit, Inc., focused on code completion tasks. The model was trained on a subset of the Stack Dedup v1.2 dataset; the training data contains 20 programming languages, listed in descending order by token count: Markdown, Java, JavaScript, Python, TypeScript, PHP, SQL, JSX, reStructuredText, Rust, C, CSS, Go, C++, HTML, Vue, Ruby, Jupyter Notebook, R, Shell. The training dataset totals 175B tokens, repeated for 3 epochs, for a total of 525B tokens trained (approximately 195 tokens per parameter). The model was trained on the MosaicML platform using 256 A100-40GB GPUs, employing advanced techniques such as Flash Attention (fast training and inference), ALiBi positional embeddings (supporting variable context lengths at inference time), and the LionW optimizer. Replit hopes that the model can be used by anyone as a base model for fine-tuning for specific applications, with no strict restrictions on commercial use. The pretraining dataset may contain offensive or inappropriate content; even after data cleaning and filtering, such content may still be reflected in the text generated by the model. Users are advised to use it cautiously in production systems and not to use it for applications that may cause harm or distress to individuals or groups. The model checkpoints and vocabulary files are licensed under CC BY-SA-4.0, requiring attribution to Replit, a link to the license, and an indication of whether changes were made; the source code files (*.py) are licensed under Apache 2.0. Usage: first install the latest version of the dependencies, then load the model via the Hugging Face Transformers library. To use BF16 precision and the optimized Triton FlashAttention implementation on a GPU, additional dependencies need to be installed, and the model converted to bfloat16. Since ReplitLM is not a class in the Transformers library, trust_remote_code=True must be passed in the from_pretrained method. The model uses a custom SentencePiece Unigram tokenizer, with a vocabulary optimized for code, containing 32768 tokens, and requires the sentencepiece library to be installed. When using the tokenizer, clean_up_tokenization_spaces=False must be set to avoid removing spaces in the output, which would affect the syntactic correctness of the generated code. The transformers library can be used to generate code, and different decoding methods and parameters can be tried to achieve the best results. Loading with 8-bit and 4-bit quantization is supported: 8-bit loading requires installing dependencies such as bitsandbytes, using load_in_8bit=True and device_map='auto'; 4-bit loading had not yet been merged into the latest versions of transformers and accelerate at the time of writing, but can be used by installing the main branch dependencies. Post-processing is important for code generation models; recommended steps include: stopping generation when the EOS token is encountered, removing trailing whitespace, setting a reasonable max_tokens according to the completion use case, and truncating the generation at stop words such as return, def, "```", "\n\n\n", to avoid generating incomplete code when max_tokens is greater than the expected generation length. The model's self-reported pass@1 result on HumanEval is 0.219.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools