Instructions to use akshaybharadwaj96/nl-code-gen-python with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use akshaybharadwaj96/nl-code-gen-python with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Salesforce/codegen-350M-mono") model = PeftModel.from_pretrained(base_model, "akshaybharadwaj96/nl-code-gen-python") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files1234456712 unmodified lines202122232425262728293031322627282930313334353637383911 unmodified lines515253495455565758596061516263646555666768697071727374757677617879808182838485868767888969909171929373949596979899100791011021031041051061071081091101111121 unmodified line114115116878889909192939495969798991001011021031041051061171181191201211221231241251121131141151161171181191201211221231241251261271281291301301311321311321331341351361371341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741381391401 unmodified line142143144182183184185186187188189190191192193194195196197198199200145146147148149150151202152204205206153---base_model: Salesforce/codegen-350M-monolibrary_name: peftlicense: apache-2.0license: mitdatasets:- google/code_x_glue_ct_code_to_textlanguage:12 unmodified lines### Model Description
<!-- Provide a longer summary of what this model is. -->This model is a fine-tuned variant of Salesforce/codegen-350M-mono, specialized for natural language to code generation in Python. It takes natural language instructions (e.g., “check MySQL database connection”) and generates the corresponding Python code snippet. The model was trained on a curated text-to-code dataset containing diverse programming instructions and function-level examples to improve semantic and syntactic accuracy.
- **Developed by:** Akshay Bharadwaj
- **Developed by:** [More Information Needed]
- **Model type:** [More Information Needed]- **Language(s) (NLP):** [More Information Needed]- **License:** [More Information Needed]- **Finetuned from model [optional]:** [More Information Needed]- **Model type:** Transformer-based Causal Language Model- **Language(s) (NLP):** English (Prompts) and Python (Code Outputs)- **License:** MIT License- **Finetuned from model [optional]:** Salesforce/codegen-350M-mono
<!-- ### Model Sources [optional]
11 unmodified lines
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
[More Information Needed]The model can be used for:
* Translating natural language prompts into functional Python code.
* Assisting in code autocompletion or boilerplate generation.
* Supporting educational and prototyping environments.
### Downstream Use [optional]### Downstream Use
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
[More Information Needed]Can be integrated into:
* Developer tools (IDE plugins or assistants).
* Chatbots for code assistance or educational coding tutors.
* LLM pipelines for multi-step reasoning or coding workflows.
### Out-of-Scope Use
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
[More Information Needed]* Generating production-level code without human review.
* Security-critical or real-time applications (e.g., code execution automation).
* Generation of malicious or unsafe code.
## Bias, Risks, and Limitations
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
[More Information Needed]* The model may produce incomplete or syntactically incorrect code for ambiguous prompts.
### Recommendations* It can misinterpret vague natural language queries (semantic drift).
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->* Potential bias toward common Python idioms and limited handling of rare libraries or APIs.
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
## How to Get Started with the Model
Use the code below to get started with the model.```from transformers import AutoTokenizer, AutoModelForCausalLM
[More Information Needed]model_id = "akshayb/nl-code-gen-python"tokenizer = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "write a python function to check mysql database connection"inputs = tokenizer(prompt, return_tensors="pt")outputs = model.generate(**inputs, max_new_tokens=256)print(tokenizer.decode(outputs[0], skip_special_tokens=True))```
## Training Details
1 unmodified line
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
[More Information Needed]
### Training Procedure
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
#### Preprocessing [optional]
[More Information Needed]
#### Training Hyperparameters
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
#### Speeds, Sizes, Times [optional]
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
[More Information Needed]The dataset contains paired natural language descriptions and Python function implementations, collected and cleaned from public code repositories and text-to-code benchmarks (e.g., CodeXGLUE). Preprocessing involved deduplication, tokenization, and removal of incomplete code samples.
## Evaluation
<!-- This section describes the evaluation protocols and provides the results. -->
### Testing Data, Factors & Metrics
#### Testing Data
<!-- This should link to a Dataset Card if possible. -->
[More Information Needed]
#### Factors
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
[More Information Needed]
#### Metrics
<!-- These are the evaluation metrics being used, ideally with a description of why. -->For Comparison between Base Model and Fine-tuned model, we use the following metrics:
[More Information Needed]
### Results| Metric | Focus | Strength || ---------------- | ------------------------------ | ----------------------------------------- || **BLEU** | Token-level similarity | Measures fluency and lexical accuracy || **CodeBLEU** | Lexical + syntactic + semantic | Captures holistic code quality || **Exact Match** | String equality | Strict correctness measure || **Syntax Match** | AST structure | Validates syntactic and logical integrity |
[More Information Needed]
#### Summary
## Model Examination [optional]
<!-- Relevant interpretability work for the model goes here -->
[More Information Needed]
## Environmental Impact
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
- **Hardware Type:** [More Information Needed]- **Hours used:** [More Information Needed]- **Cloud Provider:** [More Information Needed]- **Compute Region:** [More Information Needed]- **Carbon Emitted:** [More Information Needed]
## Technical Specifications [optional]
### Model Architecture and Objective
[More Information Needed]
### Compute Infrastructure
[More Information Needed]
#### Hardware
[More Information Needed]
#### Software
[More Information Needed]
## Citation [optional]
1 unmodified line
**BibTeX:**
[More Information Needed]
**APA:**
[More Information Needed]
## Glossary [optional]
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
[More Information Needed]
## More Information [optional]
[More Information Needed]
## Model Card Authors [optional]
[More Information Needed]@misc{akshay2025nlcodegen, title={Natural Language to Code Generation (Fine-tuned CodeGen-350M)}, author={Akshay Bharadwaj}, year={2025}, howpublished={\url{https://huggingface.co/akshayb/nl-code-gen-python}}}
## Model Card Contact
[More Information Needed]### Framework versions -->- PEFT 0.7.2.dev0README.md+63-117