CoolFace
Modelpublic

pharrow/TinyLlama-HTMLWeb-coder

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes14downloads
Model Card

license: apache-2.0 tags:

  • tinyllama
  • causal-lm
  • merged-lora basemodel: TinyLlama/TinyLlama-1.1B-Chat-v1.0 mergedfrom:
  • snaplora-adapted ---

# TinyLlama (Merged LoRA)

This repository contains a TinyLlama model with LoRA weights merged into the base.

  • Base model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
  • Adapter: snaplora-adapted
  • Merge date: 2025-09-14 23:12:26Z UTC

## Usage

python
    from transformers import AutoModelForCausalLM, AutoTokenizer
    import torch

    model_id = "<this-repo-id>"
    tok = AutoTokenizer.from_pretrained(model_id, use_fast=True)
    model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")

    prompt = "Write a haiku about tiny models."
    inputs = tok(prompt, return_tensors="pt").to(model.device)
    with torch.no_grad():
        out = model.generate(**inputs, max_new_tokens=64)
    print(tok.decode(out[0], skip_special_tokens=True))

## Notes

  • The adapter was merged into the base weights using peft.PeftModel.merge_and_unload().
  • Files are saved with safetensors when possible.