File size: 1,242 Bytes
6e2901a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
    license: apache-2.0

    tags:

      - tinyllama

      - causal-lm

      - merged-lora

    base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0

    merged_from:

      - 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.