Download train_phi3.py from Squidnutz/elevated: direct link, hf CLI and curl.
- Browser
- Download file 507 Bytes
-
https://huggingface.co/Squidnutz/elevated/resolve/main/train_phi3.py
- Command line
-
hf download hf://Squidnutz/elevated/train_phi3.py
-
curl -L -o train_phi3.py https://huggingface.co/Squidnutz/elevated/resolve/main/train_phi3.py
507 Bytes
| from transformers import AutoTokenizer, AutoModelForCausalLM, Trainer, TrainingArguments | |
| from datasets import load_dataset | |
| # Load model and tokenizer | |
| model_name = "microsoft/Phi-3-mini-128k-instruct" | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| model = AutoModelForCausalLM.from_pretrained(model_name) | |
| # Load dataset | |
| dataset = load_dataset("text", data_files="combined_tokenized_data.txt")["train"] | |
| # ... (rest of your code for tokenization, data collator, training arguments, etc.) | |