Run this model with HF Jobs
Run MouezYazidi/Py-phi-4-coder_LoRA on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/MouezYazidi/Py-phi-4-coder_LoRA. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/MouezYazidi/Py-phi-4-coder_LoRA on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use MouezYazidi/Py-phi-4-coder_LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MouezYazidi/Py-phi-4-coder_LoRA with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MouezYazidi/Py-phi-4-coder_LoRA", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Update README.md
Browse files8 unmodified lines9101112131415162 unmodified lines192021228 unmodified lineslicense: apache-2.0language:- en---# Uploaded model- **Developed by:** MouezYazidi2 unmodified linesThis llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)8 unmodified lines910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394952 unmodified lines98991001018 unmodified lineslicense: apache-2.0language:- endatasets:- iamtarun/python_code_instructions_18k_alpaca---# Model DescriptionThis model is fine-tuned from **microsoft/phi-4**. This model is enhanced to improve coding capabilities, particularly in Python, as it was fine-tuned on a dataset of 18,000 Python samples using Alpaca prompt instructions.Please refer to this repository when using the model.## To perform inference using these LoRA adapters, please use the following code:````Python# Installs Unsloth, Xformers (Flash Attention) and all other packages!!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"!pip install --no-deps "xformers<0.0.27" "trl<0.9.0" peft accelerate bitsandbytes````````Pythonfrom unsloth import FastLanguageModelmodel, tokenizer = FastLanguageModel.from_pretrained(model_name = "MouezYazidi/Py-phi-4-coder_LoRA",max_seq_length = 2048,dtype = None,load_in_4bit = True,)FastLanguageModel.for_inference(model) # Enable native 2x faster inferencealpaca_prompt = """Below is an instruction describing a task, along with an input providing additional context. Your task is to generate a clear, concise, and accurate Python code response that fulfills the given request.### Instruction:{}### Input:{}### Response:{}"""inputs = tokenizer([alpaca_prompt.format("", # instruction"""Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order..if you gonna use any external libraries you need to import it first""", # input"", # output - leave this blank for generation!)], return_tensors = "pt").to("cuda")from transformers import TextStreamertext_streamer = TextStreamer(tokenizer)_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 512)````````MarkdownThe Outout is:Below is an instruction describing a task, along with an input providing additional context. Your task is to generate a clear, concise, and accurate Python code response that fulfills the given request.### Instruction:Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order.. if you gonna use any external libraries you need to import it first### Input:### Response:def twoSum(nums, target):# Create a dictionary to store the numbers and their indicesnum_dict = {}for i, num in enumerate(nums):# Check if the complement of the current number is in the dictionaryif target - num in num_dict:return [num_dict[target - num], i]# Add the current number to the dictionarynum_dict[num] = i<|im_end|>````# Uploaded model- **Developed by:** MouezYazidi2 unmodified linesThis llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
README.md+80-1