Text Generation
Transformers
Safetensors
English
qwen2
conversational
text-generation-inference
8-bit precision
bitsandbytes
Instructions to use LucidityAI/pico-mini-v1-.5b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LucidityAI/pico-mini-v1-.5b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LucidityAI/pico-mini-v1-.5b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LucidityAI/pico-mini-v1-.5b") model = AutoModelForCausalLM.from_pretrained("LucidityAI/pico-mini-v1-.5b") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use LucidityAI/pico-mini-v1-.5b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LucidityAI/pico-mini-v1-.5b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LucidityAI/pico-mini-v1-.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LucidityAI/pico-mini-v1-.5b
- SGLang
How to use LucidityAI/pico-mini-v1-.5b 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 "LucidityAI/pico-mini-v1-.5b" \ --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": "LucidityAI/pico-mini-v1-.5b", "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 "LucidityAI/pico-mini-v1-.5b" \ --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": "LucidityAI/pico-mini-v1-.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LucidityAI/pico-mini-v1-.5b with Docker Model Runner:
docker model run hf.co/LucidityAI/pico-mini-v1-.5b
Pico Mini V1
Pico v1 is a work in progress model. Based off Qwen 2.5 .5b model, it has been fine tuned for automatic COT and self reflection.
When making a output, Pico will create three sections, a reasoning section, a self-reflection section and a output section.
Pico Mini v1 struggles with non-question related tasks (Small talk, roleplay, etc).
Pico Mini v1 can struggle with staying on topic at times.
Here is a example of how you can use it:
import torch
# Load the model and tokenizer from the Hugging Face Model Hub (test/test repository)
output_dir = "test/test"
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print("Loading the model and tokenizer from the Hugging Face Hub...")
model = AutoModelForCausalLM.from_pretrained(output_dir).to(device) # Ensure model is on the same device
tokenizer = AutoTokenizer.from_pretrained(output_dir)
# Define the testing prompt
prompt = "What color is the sky?"
print(f"Testing prompt: {prompt}")
# Tokenize input and move to the same device as the model
inputs = tokenizer(prompt, return_tensors="pt").to(device) # Ensure inputs are on the same device
# Generate response
print("Generating response...")
outputs = model.generate(
**inputs,
max_new_tokens=1550, # Adjust the max tokens if needed
temperature=0.5, # Adjust for response randomness
top_k=50, # Adjust for top-k sampling
top_p=0.9 # Adjust for nucleus sampling
)
# Decode and print the response
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print("Generated response:")
print(response)
- Downloads last month
- 1