Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

DrNerd
/
LLAMA-3-From-Scratch

Text Generation
Transformers
English
text-generation-inference
custom-code
from-scratch
llama-inspired
educational
wikitext
deepseek-tokenizer
~200M-params
Model card Files Files and versions
xet
Community

Instructions to use DrNerd/LLAMA-3-From-Scratch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use DrNerd/LLAMA-3-From-Scratch with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="DrNerd/LLAMA-3-From-Scratch")
    # Load model directly
    from transformers import AutoModel
    model = AutoModel.from_pretrained("DrNerd/LLAMA-3-From-Scratch", dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use DrNerd/LLAMA-3-From-Scratch with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "DrNerd/LLAMA-3-From-Scratch"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "DrNerd/LLAMA-3-From-Scratch",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker
    docker model run hf.co/DrNerd/LLAMA-3-From-Scratch
  • SGLang

    How to use DrNerd/LLAMA-3-From-Scratch 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 "DrNerd/LLAMA-3-From-Scratch" \
        --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": "DrNerd/LLAMA-3-From-Scratch",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    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 "DrNerd/LLAMA-3-From-Scratch" \
            --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": "DrNerd/LLAMA-3-From-Scratch",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use DrNerd/LLAMA-3-From-Scratch with Docker Model Runner:

    docker model run hf.co/DrNerd/LLAMA-3-From-Scratch
LLAMA-3-From-Scratch
4.41 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
DrNerd's picture
DrNerd
Updated README.md
37db96e verified about 1 year ago
  • .gitattributes
    1.52 kB
    initial commit about 1 year ago
  • README.md
    3.93 kB
    Updated README.md about 1 year ago
  • inference.py
    17.5 kB
    Upload 7 files about 1 year ago
  • loss_plot_step_0_to_120.png
    59.1 kB
    Upload 7 files about 1 year ago
  • model_architecture.py
    36.4 kB
    Upload 7 files about 1 year ago
  • step_600.pt
    2.2 GB
    xet
    Upload 7 files about 1 year ago
  • step_800.pt
    2.2 GB
    xet
    Upload 7 files about 1 year ago
  • wikitext2_tokens_128k.pt

    Pickle imports

    • No problematic imports detected

    What is a pickle import?

    7.3 MB
    xet
    Upload 7 files about 1 year ago
  • wikitext2_val_tokens_128k.pt

    Pickle imports

    • No problematic imports detected

    What is a pickle import?

    761 kB
    xet
    Upload 7 files about 1 year ago