Instructions to use Mr-FineTuner/without_exampleSentence with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mr-FineTuner/without_exampleSentence with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Mr-FineTuner/without_exampleSentence", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use Mr-FineTuner/without_exampleSentence with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Mr-FineTuner/without_exampleSentence to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Mr-FineTuner/without_exampleSentence to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Mr-FineTuner/without_exampleSentence to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Mr-FineTuner/without_exampleSentence", max_seq_length=2048, )
Update README.md
Browse files
README.md
CHANGED
|
@@ -6,9 +6,71 @@ tags:
|
|
| 6 |
|
| 7 |
# Model Card for Model ID
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
## Model Details
|
| 14 |
|
|
|
|
| 6 |
|
| 7 |
# Model Card for Model ID
|
| 8 |
|
| 9 |
+
model = FastLanguageModel.get_peft_model(
|
| 10 |
+
model,
|
| 11 |
+
r = 32, # Choose any number > 0 ! Suggested 8, 16, 32, 64, 128
|
| 12 |
+
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
|
| 13 |
+
"gate_proj", "up_proj", "down_proj",],
|
| 14 |
+
lora_alpha = 32,
|
| 15 |
+
lora_dropout = 0.1, # Supports any, but = 0 is optimized
|
| 16 |
+
bias = "none", # Supports any, but = "none" is optimized
|
| 17 |
+
# [NEW] "unsloth" uses 30% less VRAM, fits 2x larger batch sizes!
|
| 18 |
+
use_gradient_checkpointing = "unsloth", # True or "unsloth" for very long context
|
| 19 |
+
random_state = 3407,
|
| 20 |
+
use_rslora = False, # We support rank stabilized LoRA
|
| 21 |
+
loftq_config = None, # And LoftQ
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
chat_template = """
|
| 25 |
+
### Input:
|
| 26 |
+
Generate a sentence that includes a word at the CEFR level {INPUT}. The sentence should be meaningful, contextually appropriate, and clearly demonstrate the usage of the word at the specified CEFR level. Ensure that the sentence is suitable for learners at this level, providing clear context for the word meaning.
|
| 27 |
+
Make the output format to be like this
|
| 28 |
+
The word is: sleep and it is a verb. Example sentence: I sleep early.
|
| 29 |
+
The word is: reciprocate and it is a verb. Example sentence: He reciprocated her kindness warmly.
|
| 30 |
+
|
| 31 |
+
### Response:
|
| 32 |
+
{OUTPUT}
|
| 33 |
+
|
| 34 |
+
### Input:
|
| 35 |
+
Generate a sentence that includes a word at the CEFR level {INPUT}. The sentence should be meaningful, contextually appropriate, and clearly demonstrate the usage of the word at the specified CEFR level. Ensure that the sentence is suitable for learners at this level, providing clear context for the word meaning.
|
| 36 |
+
Make the output format to be like this
|
| 37 |
+
The word is: sleep and it is a verb. Example sentence: I sleep early.
|
| 38 |
+
The word is: reciprocate and it is a verb. Example sentence: He reciprocated her kindness warmly.
|
| 39 |
+
|
| 40 |
+
### Response:
|
| 41 |
+
{OUTPUT}
|
| 42 |
+
|
| 43 |
+
"""
|
| 44 |
+
|
| 45 |
+
from trl import SFTTrainer
|
| 46 |
+
from transformers import TrainingArguments
|
| 47 |
+
from unsloth import is_bfloat16_supported
|
| 48 |
+
|
| 49 |
+
trainer = SFTTrainer(
|
| 50 |
+
model = model,
|
| 51 |
+
tokenizer = tokenizer,
|
| 52 |
+
train_dataset = dataset,
|
| 53 |
+
dataset_text_field = "text",
|
| 54 |
+
max_seq_length = max_seq_length,
|
| 55 |
+
dataset_num_proc = 2,
|
| 56 |
+
packing = False, # Can make training 5x faster for short sequences.
|
| 57 |
+
args = TrainingArguments(
|
| 58 |
+
per_device_train_batch_size = 1,
|
| 59 |
+
gradient_accumulation_steps = 4,
|
| 60 |
+
warmup_steps = 5,
|
| 61 |
+
# max_steps = 120,
|
| 62 |
+
num_train_epochs = 1, # Set this instead of max_steps for full training runs
|
| 63 |
+
learning_rate = 2e-4,
|
| 64 |
+
fp16 = not is_bfloat16_supported(),
|
| 65 |
+
bf16 = is_bfloat16_supported(),
|
| 66 |
+
logging_steps = 1,
|
| 67 |
+
optim = "adamw_8bit",
|
| 68 |
+
weight_decay = 0.01,
|
| 69 |
+
lr_scheduler_type = "linear",
|
| 70 |
+
seed = 3407,
|
| 71 |
+
output_dir = "outputs",
|
| 72 |
+
),
|
| 73 |
+
)
|
| 74 |
|
| 75 |
## Model Details
|
| 76 |
|