Views
No views yet
llama-3-8b-bnb-4bit model has been fine-tuned on a dataset containing German instructions and inputs. The model employs the PEFT (Parameter Efficient Fine-Tuning) technique using LoRA (Low-Rank Adaptation) to enhance its performance efficiently.1pip install -qqq "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
2pip install -qqq --no-deps xformers trl peft accelerate bitsandbytes triton
3Make sure to check the compatibility of xformers with your PyTorch version.
4
5Usage
6You can use the fine-tuned model for inference as follows:
7
8
9from transformers import AutoTokenizer
10from unsloth import FastLanguageModel
11
12# Load the model and tokenizer
13model, tokenizer = FastLanguageModel.from_pretrained("nepalsatish/llama-3-finetuned-8b")
14
15# Prepare input
16input_prompt = """
17### Instruction: Bitte erläutern Sie
18### Input: Earth
19### Response:
20"""
21inputs = tokenizer(input_prompt, return_tensors="pt").to("cuda")
22
23# Generate response
24outputs = model.generate(**inputs, max_new_tokens=64, use_cache=True)
25response = tokenizer.batch_decode(outputs)
26
27print(response)
28Training
29The model has been trained using the CustomSFTTrainer class, which captures the training loss. The training data is in JSON format, and the prompts are formatted according to the Alpaca instruction-response structure.
30
31To train the model, use the provided training script. Adjust the hyperparameters in the TrainingArguments section as needed.
32
33Evaluation
34Training loss is recorded and stored in training_loss.csv. A plot of the training loss over time is saved as training_loss_plot.png. You can analyze these files to monitor the model's performance during training.
35
36Contributing
37Contributions are welcome! Please feel free to open issues, submit pull requests, or suggest improvements to the model or documentation.
38
39License
40This project is licensed under the MIT License - see the LICENSE file for details.
41
42Acknowledgments
43Thanks to the Hugging Face team and the community for providing the tools and resources needed for training and deploying language models.
44
45This README will serve as a comprehensive guide for users who want to understand, use, or contribute to your fine-tuned LLaMA-3 model.