Text Generation
Transformers
PyTorch
Safetensors
GGUF
English
llama
text-generation-inference
unsloth
trl
sft
conversational
Instructions to use Ramikan-BR/TiamaPY-v34 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ramikan-BR/TiamaPY-v34 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ramikan-BR/TiamaPY-v34") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Ramikan-BR/TiamaPY-v34") model = AutoModelForCausalLM.from_pretrained("Ramikan-BR/TiamaPY-v34", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Ramikan-BR/TiamaPY-v34 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Ramikan-BR/TiamaPY-v34:Q4_K_M # Run inference directly in the terminal: llama cli -hf Ramikan-BR/TiamaPY-v34:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Ramikan-BR/TiamaPY-v34:Q4_K_M # Run inference directly in the terminal: llama cli -hf Ramikan-BR/TiamaPY-v34:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Ramikan-BR/TiamaPY-v34:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Ramikan-BR/TiamaPY-v34:Q4_K_M
Use Docker
docker model run hf.co/Ramikan-BR/TiamaPY-v34:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use Ramikan-BR/TiamaPY-v34 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ramikan-BR/TiamaPY-v34" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ramikan-BR/TiamaPY-v34", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Ramikan-BR/TiamaPY-v34:Q4_K_M
- SGLang
How to use Ramikan-BR/TiamaPY-v34 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Ramikan-BR/TiamaPY-v34" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ramikan-BR/TiamaPY-v34", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Ramikan-BR/TiamaPY-v34" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ramikan-BR/TiamaPY-v34", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Ramikan-BR/TiamaPY-v34 with Ollama:
ollama run hf.co/Ramikan-BR/TiamaPY-v34:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Ramikan-BR/TiamaPY-v34 with Docker Model Runner:
docker model run hf.co/Ramikan-BR/TiamaPY-v34:Q4_K_M
- Lemonade
How to use Ramikan-BR/TiamaPY-v34 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Ramikan-BR/TiamaPY-v34:Q4_K_M
Run and chat with the model
lemonade run user.TiamaPY-v34-Q4_K_M
List all available models
lemonade list
- Atomic Chat
# 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(
"Eu preciso treinar uma IA gpt2 do hugginface em meu computador", # 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)
# Answer
<s> Below is an instruction that describes a task related to Python programming or computer science concepts. Provide a detailed, accurate, and helpful response that addresses the query or solves the problem presented. Follow these guidelines:
1. If the task involves coding, provide a complete, working Python solution with explanations.
2. If it's a conceptual question, explain thoroughly, using examples where appropriate.
3. Break down complex problems or concepts into steps or components.
4. If you're unsure about any part of your response, clearly state your level of confidence and any assumptions you're making.
5. If the query is ambiguous or lacks necessary information, ask for clarification before proceeding.
6. After providing your response, briefly summarize the key points or solution.
Remember, accuracy and helpfulness are crucial. Avoid making unfounded claims or providing incorrect information.
### Input:
Eu preciso treinar uma IA gpt2 do hugginface em meu computador
### Output:
# Importações necessárias
from transformers import GPT2LMHeadModel, GPT2Tokenizer
from transformers import TrainingArguments, Trainer
from transformers.data import DataCollatorForLanguageModeling
from transformers.data.processors import DataProcessor
# Configurações
training_args = TrainingArguments(
output_dir='./resultados',
evaluation_strategy='epoch',
learning_rate=2e-5,
per_device_train_batch_size=8,
eval_steps=1000,
num_warmupSteps=500,
weighted_metric='accuracy',
)
# Carregamento do tokenizador
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
# Carregamento do modelo
modelo = GPT2LMHeadModel.from_pretrained('gpt2')
# Configurações do tracker
tracker = DataProcessor(
input_class=DataProcessor,
batch_size=1,
max_length=100,
padding=True,
truncation=True,
)
# Treinando o modelo
trainer = Trainer(
args=training_args,
train_loop=tracker,
trainable_pipelines=[],
)
# Treinando o modelo
trainer.train()
# Evaluação do modelo
evaluador = DataCollatorForLanguageModeling(
tokenizer=tokenizer,
model=modelo,
padding=True,
max_length=100,
batch_size=8,
)
# Evalua o modelo
resultados = trainer.evaluate()
# Imprimir os resultados
for name, loss, acc in resultados:
print(f'{name}: {loss}, {acc:.2f}%')</s>
Uploaded model
- Developed by: Ramikan-BR
- License: apache-2.0
- Finetuned from model : unsloth/tinyllama-chat-bnb-4bit
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 204
Model tree for Ramikan-BR/TiamaPY-v34
Base model
unsloth/tinyllama-chat-bnb-4bit