Skylion007/openwebtext
Viewer • Updated • 8.01M • 71.6k • 517
How to use tsingla98/frawdllm-100m with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="tsingla98/frawdllm-100m", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("tsingla98/frawdllm-100m", trust_remote_code=True, dtype="auto")How to use tsingla98/frawdllm-100m with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tsingla98/frawdllm-100m"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "tsingla98/frawdllm-100m",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/tsingla98/frawdllm-100m
How to use tsingla98/frawdllm-100m with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "tsingla98/frawdllm-100m" \
--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": "tsingla98/frawdllm-100m",
"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 "tsingla98/frawdllm-100m" \
--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": "tsingla98/frawdllm-100m",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use tsingla98/frawdllm-100m with Docker Model Runner:
docker model run hf.co/tsingla98/frawdllm-100m
A 109M parameter language model trained from scratch for learning purposes.
FrawdLLM is a GPT-style decoder-only transformer trained through the full LLM pipeline:
| Parameter | Value |
|---|---|
| Parameters | 109M |
| Layers | 12 |
| Hidden Size | 768 |
| Attention Heads | 12 |
| Context Length | 1024 |
| Vocab Size | 32,000 |
| Position Encoding | RoPE |
from transformers import AutoModelForCausalLM, PreTrainedTokenizerFast
import torch
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained(
"tsingla98/frawdllm-100m",
trust_remote_code=True
)
tokenizer = PreTrainedTokenizerFast.from_pretrained("tsingla98/frawdllm-100m")
# Format prompt with chat template
prompt = "<|bos|><|user|>What is photosynthesis?<|assistant|>"
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
# Generate
with torch.no_grad():
output = model.model.generate(
inputs.input_ids,
max_new_tokens=150,
temperature=0.8,
top_k=50,
)
response = tokenizer.decode(output[0], skip_special_tokens=False)
print(response)
This is a small model (109M params) trained primarily for learning purposes. It:
This model is intended for:
scripts/ directory in the GitHub repoMIT