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)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Ramikan-BR/TiamaPY-v34") model = AutoModelForCausalLM.from_pretrained("Ramikan-BR/TiamaPY-v34") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use Ramikan-BR/TiamaPY-v34 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Ramikan-BR/TiamaPY-v34", filename="unsloth.F16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Ramikan-BR/TiamaPY-v34 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -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-server -hf Ramikan-BR/TiamaPY-v34:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Ramikan-BR/TiamaPY-v34:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -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/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -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
- 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 Studio new
How to use Ramikan-BR/TiamaPY-v34 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 Ramikan-BR/TiamaPY-v34 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 Ramikan-BR/TiamaPY-v34 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Ramikan-BR/TiamaPY-v34 to start chatting
- 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
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)# 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
- 753
Model tree for Ramikan-BR/TiamaPY-v34
Base model
unsloth/tinyllama-chat-bnb-4bit
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Ramikan-BR/TiamaPY-v34", filename="", )