wikimedia/wikipedia
Viewer • Updated • 61.6M • 237k • 1.4k
How to use uisikdag/umitllama-mini-english with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="uisikdag/umitllama-mini-english") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("uisikdag/umitllama-mini-english")
model = AutoModelForCausalLM.from_pretrained("uisikdag/umitllama-mini-english", device_map="auto")How to use uisikdag/umitllama-mini-english with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "uisikdag/umitllama-mini-english"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "uisikdag/umitllama-mini-english",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/uisikdag/umitllama-mini-english
How to use uisikdag/umitllama-mini-english with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "uisikdag/umitllama-mini-english" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "uisikdag/umitllama-mini-english",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "uisikdag/umitllama-mini-english" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "uisikdag/umitllama-mini-english",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use uisikdag/umitllama-mini-english with Docker Model Runner:
docker model run hf.co/uisikdag/umitllama-mini-english
~22M parameter GPT style toy model trained with wikipedia.en 1M rows.
epochs:3
Trained on RTX 2060 6GB VRAM 54 GB RAM
import torch
import argparse
from transformers import pipeline
def main():
parser = argparse.ArgumentParser(description="Minimal Llama Inference")
# This is the "model_id argument" you asked for
parser.add_argument(
"model_id",
nargs="?",
default="uisikdag/umitllama-mini-english",
help="Hugging Face model ID or local path"
)
args = parser.parse_args()
print(f"Loading model from HF: {args.model_id}")
# Create pipeline
generator = pipeline(
"text-generation",
model=args.model_id,
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
device_map="auto",
trust_remote_code=True
)
# Generate
prompt = "The economy is:"
print(f"\nPrompt: {prompt}")
output = generator(
prompt,
max_new_tokens=50,
do_sample=True,
temperature=0.7,
pad_token_id=generator.tokenizer.eos_token_id
)
print(f"\nResponse:\n{output[0]['generated_text']}")
if __name__ == "__main__":
main()