Instructions to use Shivenys/phi3-mini-lora-tutorial with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Shivenys/phi3-mini-lora-tutorial with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-mini-4k-instruct") model = PeftModel.from_pretrained(base_model, "Shivenys/phi3-mini-lora-tutorial") - Transformers
How to use Shivenys/phi3-mini-lora-tutorial with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Shivenys/phi3-mini-lora-tutorial", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download chat_template.jinja from Shivenys/phi3-mini-lora-tutorial: direct link, hf CLI and curl.
- Browser
- Download file 414 Bytes
-
https://huggingface.co/Shivenys/phi3-mini-lora-tutorial/resolve/main/chat_template.jinja
- Command line
-
hf download hf://Shivenys/phi3-mini-lora-tutorial/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/Shivenys/phi3-mini-lora-tutorial/resolve/main/chat_template.jinja
414 Bytes
| {% for message in messages %}{% if message['role'] == 'system' %}{{'<|system|> | |
| ' + message['content'] + '<|end|> | |
| '}}{% elif message['role'] == 'user' %}{{'<|user|> | |
| ' + message['content'] + '<|end|> | |
| '}}{% elif message['role'] == 'assistant' %}{{'<|assistant|> | |
| ' + message['content'] + '<|end|> | |
| '}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|> | |
| ' }}{% else %}{{ eos_token }}{% endif %} |