For the first time after 9 refinements with LORA accumulations, the model answered the Fibonassi sequence without errors on both questions and wrote code to train an offline AI. Really this little model Qwen2-0.5B is very good! And the way it responds to the code and gives information is perfect, impressive!
['Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Input:\nContinue the fibonnaci sequence.\n\n### Output:\n1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811']
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
Input:
What is fibonacci sequence?
Output:
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, usually starting with 0 and 1. The sequence goes like this: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765
3 - Question:
if False:
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "lora_model", # YOUR MODEL YOU USED FOR TRAINING
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
alpaca_prompt = You MUST copy from above!
inputs = tokenizer(
[
alpaca_prompt.format(
"I need train a AI offline on my computer, give me a code very good for this case.", # instruction
"", # input
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
Input:
I need train a AI offline on my computer, give me a code very good for this case.
Output:
Sure, I'd be happy to help you with that! Here's a simple example of how you could use TensorFlow, a popular deep learning library for Python, to train an AI model on your computer.
Firstly, you'll need to install TensorFlow on your computer. You can do this using pip:
pip install tensorflow
Once you have installed TensorFlow, you can start training your model. Here's a simple example:
python
1import tensorflow as tf
2from tensorflow import keras
3from tensorflow.keras import layers
45# define the model6model = tf.keras.Sequential([7 tf.keras.layers.Dense(64, activation='relu', input_shape=(784,)),8 tf.keras.layers.Dense(64, activation='relu'),9 tf.keras.layers.Dense(10, activation='softmax')10])1112# compile the model13model.compile(optimizer='adam',14 loss='categorical_crossentropy',15 metrics=['accuracy'])1617# train the model18model.fit(x_train, y_train, epochs=10)
In this example, we are using the Sequential model, which is a simple way to build a model. The model consists of two layers: one dense layer with 64 units and ReLU activation, and another dense layer with 64 units and also ReLU activation. The output layer has 10 units and softmax activation.
The model is then compiled with the Adam optimizer and categorical cross-entropy loss function. The model is then trained for 10 epochs.
Please note that this is a very simple example and you may need to adjust the model architecture, number of layers, number of units, and other parameters depending on your specific problem.
Also, remember that you need to install the necessary libraries first, which are TensorFlow and Keras. You can do this using pip:
pip install tensorflow
pip install keras
Once you have installed these libraries, you can run your code.
I hope this helps!<|endoftext|>
Uploaded model
Developed by: Ramikan-BR
License: apache-2.0
Finetuned from model : unsloth/qwen2-0.5b-bnb-4bit
This qwen2 model was trained 2x faster with Unsloth and Huggingface's TRL library.