Downloads · 30 days
44
8% of all-time downloads
SarthakBhatore/codegen-350M-mono-18k-alpaca-python
codegen-350M-mono-18k-alpaca-python is a text generation model from SarthakBhatore. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
44
8% of all-time downloads
All-time downloads
564
Public
Repo size
1.4 GB
Likes
2
Public
Click a slice to open those files.
.bin713 MB · 100%
From the Hugging Face model README
Hugging Face Model GitHub Stars License
This repository contains a fine-tuned language model, "CodeGen-350M-mono-18k-Alpaca-Python," which is based on the Salesforce-codegen-350M model and fine-tuned on the "iamtarun/python_code_instructions_18k_alpaca" dataset. This model is designed to assist developers in generating Python code instructions and snippets based on natural language prompts.
Model Details Model Name: CodeGen-350M-mono-18k-Alpaca-Python Base Model: Salesforce-codegen-350M Dataset: iamtarun/python_code_instructions_18k_alpaca Model Size: 350 million parameters Usage You can use this model in various NLP tasks that involve generating Python code from natural language prompts. Below is an example of how to use this model with the Hugging Face Transformers library in Python:
python Copy code from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "your-username/codegen-350M-mono-18k-alpaca-python" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained(model_name)
text = "Create a function that calculates the factorial of a number in Python."
input_ids = tokenizer.encode(text, return_tensors="pt")
output = model.generate(input_ids, max_length=100, num_return_sequences=1, no_repeat_ngram_size=2)
generated_code = tokenizer.decode(output[0], skip_special_tokens=True) print(generated_code) For more information on using Hugging Face models, refer to the official documentation.
Fine-Tuning Details The CodeGen-350M-mono-18k-Alpaca-Python model was fine-tuned on the "iamtarun/python_code_instructions_18k_alpaca" dataset using the Hugging Face Transformers library. The fine-tuning process involved adapting the base Salesforce-codegen-350M model to generate Python code instructions specifically for the provided dataset.