Instructions to use Ramikan-BR/P3-mini-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ramikan-BR/P3-mini-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ramikan-BR/P3-mini-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Ramikan-BR/P3-mini-v1") model = AutoModelForCausalLM.from_pretrained("Ramikan-BR/P3-mini-v1") 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/P3-mini-v1 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Ramikan-BR/P3-mini-v1", filename="unsloth.Q8_0.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Ramikan-BR/P3-mini-v1 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/P3-mini-v1:Q8_0 # Run inference directly in the terminal: llama cli -hf Ramikan-BR/P3-mini-v1:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Ramikan-BR/P3-mini-v1:Q8_0 # Run inference directly in the terminal: llama cli -hf Ramikan-BR/P3-mini-v1:Q8_0
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/P3-mini-v1:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf Ramikan-BR/P3-mini-v1:Q8_0
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/P3-mini-v1:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Ramikan-BR/P3-mini-v1:Q8_0
Use Docker
docker model run hf.co/Ramikan-BR/P3-mini-v1:Q8_0
- LM Studio
- Jan
- vLLM
How to use Ramikan-BR/P3-mini-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ramikan-BR/P3-mini-v1" # 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/P3-mini-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Ramikan-BR/P3-mini-v1:Q8_0
- SGLang
How to use Ramikan-BR/P3-mini-v1 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/P3-mini-v1" \ --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/P3-mini-v1", "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/P3-mini-v1" \ --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/P3-mini-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Ramikan-BR/P3-mini-v1 with Ollama:
ollama run hf.co/Ramikan-BR/P3-mini-v1:Q8_0
- Unsloth Studio
How to use Ramikan-BR/P3-mini-v1 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/P3-mini-v1 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/P3-mini-v1 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/P3-mini-v1 to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Ramikan-BR/P3-mini-v1 with Docker Model Runner:
docker model run hf.co/Ramikan-BR/P3-mini-v1:Q8_0
- Lemonade
How to use Ramikan-BR/P3-mini-v1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Ramikan-BR/P3-mini-v1:Q8_0
Run and chat with the model
lemonade run user.P3-mini-v1-Q8_0
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)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:
Write a code to create the snake game
Output:
Here is a simple implementation of the classic Snake game in Python using the Pygame library. This code will create a window with a snake that moves in a grid, eating apples and growing in length.
import pygame
import random
import time
# Initialize Pygame
pygame.init()
# Set the dimensions of the game window
width, height = 600, 600
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption('Snake Game')
# Define colors
white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 0, 0)
green = (0, 255, 0)
# Define the snake
snake_pos = [[100, 50], [90, 50], [80, 50]]
snake_dir = [0, -1]
# Define the apple
apple_pos = [random.randint(50, width-50), random.randint(50, height-50)]
# Define the score
score = 0
# Define the clock
clock = pygame.time.Clock()
# Game loop
running = True
while running:
# Handle events
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
# Move the snake
new_head = [snake_pos[0][0] + snake_dir[0], snake_pos[0][1] + snake_dir[1]]
# Check if the snake eats the apple
if new_head[0] == apple_pos[0] and new_head[1] == apple_pos[1]:
score += 1
apple_pos = [random.randint(50, width-50), random.randint(50, height-50)]
snake_pos.insert(0, new_head)
if len(snake_pos) > 10:
snake_pos.pop()
else:
snake_pos.insert(0, new_head)
snake_pos.pop()
# Check if the snake hits the wall
if new_head[0] < 0 or new_head[0] > width-100 or new_head[1] < 0 or new_head[1] > height-100:
running = False
# Draw the game
screen.fill(white)
for pos in snake_pos:
pygame.draw.rect(screen, black, pygame.Rect(pos[0], pos[1], 10, 10))
pygame.draw.rect(screen, red, pygame.Rect(apple_pos[0], apple_pos[1], 10, 10))
pygame.display.flip()
# Set the frame rate
clock.tick(10)
# Print the score
print(f'Score: {score}')
pygame.quit()
This code will create a window with a snake that moves in a grid, eating apples and growing in length. The score will be printed to the console.
Note that this is a very basic implementation and can be improved in many ways, such as adding a start screen, better collision detection, and more features.<|endoftext|>
Uploaded model
- Developed by: Ramikan-BR
- License: apache-2.0
- Finetuned from model : unsloth/Phi-3-mini-4k-instruct-bnb-4bit
This mistral model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 8
Model tree for Ramikan-BR/P3-mini-v1
Base model
unsloth/Phi-3-mini-4k-instruct-bnb-4bit
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Ramikan-BR/P3-mini-v1", filename="unsloth.Q8_0.gguf", )