Downloads · 30 days
56
1% of all-time downloads
Ramikan-BR/Qwen2-0.5B-v13
Qwen2-0.5B-v13 is a text generation model from Ramikan-BR. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
56
1% of all-time downloads
All-time downloads
4.4K
Public
Parameters
494M
3 GB on disk
Likes
0
Public
Click a slice to open those files.
.gguf994 MB · 33%
From the Hugging Face model README
1 - 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
inputs = tokenizer( [ alpaca_prompt.format( "I need train a AI offline on my computer, give me a code good for this case.", # instruction "", # input "", # output - leave this blank for generation! ) ], return_tensors = "pt").to("cuda")
from transformers import TextStreamer text_streamer = TextStreamer(tokenizer) _ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 4096)
2 - Answer
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
I need train a AI offline on my computer, give me a code good for this case.
Sure, here's a simple example of how you can train an AI model on a computer using Python and TensorFlow. This is a very basic example and doesn't include many features that are commonly used in real-world applications.
Firstly, you need to install the necessary libraries. You can do this using pip:
pip install tensorflow
Then, you can start training your model:
import tensorflow as tf
from tensorflow.keras import models, layers
# define the model
model = tf.keras.models.Sequential([
tf.keras.layers.Dense(64, activation='relu', input_shape=(100,)),
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(10)
])
# compile the model
model.compile(optimizer='adam',
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])
# train the model
model.fit(X_train, y_train, epochs=10)
Here, X_train and y_train are your training data, and X_train.shape and y_train.shape are the shape of your training data.
Please note that this is a very simple example and you may need to adjust the model architecture, number of layers, number of neurons in each layer, and other parameters depending on your specific problem.<|endoftext|>
This qwen2 model was trained 2x faster with Unsloth and Huggingface's TRL library.