Instructions to use garboab/Greta-1b-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use garboab/Greta-1b-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="garboab/Greta-1b-Preview", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("garboab/Greta-1b-Preview", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use garboab/Greta-1b-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "garboab/Greta-1b-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "garboab/Greta-1b-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/garboab/Greta-1b-Preview
- SGLang
How to use garboab/Greta-1b-Preview 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 "garboab/Greta-1b-Preview" \ --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": "garboab/Greta-1b-Preview", "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 "garboab/Greta-1b-Preview" \ --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": "garboab/Greta-1b-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use garboab/Greta-1b-Preview with Docker Model Runner:
docker model run hf.co/garboab/Greta-1b-Preview
Greta-1b-Preview
Model Details
Current state
This model is currently still in post-training and is pre-released as a preview checkpoint with gated access only.
How to run
Notice: See jinja-template for formats and tool parsing
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("garboab/Greta-1b-Preview", use_fast=True, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
"garboab/Greta-1b-Preview",
trust_remote_code=True,
device_map="auto",
)
tools = [
{
"type": "function",
"name": "search",
"description": "Search the web for information.",
"parameters": {
"type": "object",
"properties": {
"q": {
"type": "string",
"description": "Query to search for.",
},
},
"required": ["q"],
},
},
]
text = tokenizer.apply_chat_template(
[
{"role": "tools", "content": tools},
{"role": "user", "content": "Where can I read more about Garbo AI?"},
],
tokenize=False,
add_generation_prompt=True,
enable_thinking=True,
)
input_ids = tokenizer(
text,
add_bos_token=True,
return_tensors="pt"
).input_ids
output_ids = model.generate(
input_ids.cuda(),
max_new_tokens=1024,
do_sample=True,
temperature=0.1
)
print(tokenizer.decode(output_ids[0], skip_special_tokens=True).strip())
- Downloads last month
- 109