africatic/afritemp-bench
Viewer • Updated • 12.6k • 77
How to use africatic/atic with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-E4B-it")
model = PeftModel.from_pretrained(base_model, "africatic/atic")How to use africatic/atic with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="africatic/atic")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("africatic/atic", device_map="auto")How to use africatic/atic with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "africatic/atic"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "africatic/atic",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/africatic/atic
How to use africatic/atic with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "africatic/atic" \
--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": "africatic/atic",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "africatic/atic" \
--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": "africatic/atic",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use africatic/atic with Docker Model Runner:
docker model run hf.co/africatic/atic
This repository contains a LoRA adapter fine-tuned from
google/gemma-4-E4B-it on
africatic/afritemp-bench.
The adapter is intended for research on temporal reasoning and African economic, social and development data. It should be evaluated carefully before use in consequential decision-making.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model_id = "google/gemma-4-E4B-it"
adapter_id = "YOUR_HF_USERNAME/gemma-4-e4b-afritemp"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)