Duchifat-2.4-Instruct (136M) 馃惁

Duchifat-2.4-Instruct represents a significant evolution in the Duchifat series. This version (2.4) is a specialized, instruction-tuned model that has been refined through a massive training pipeline to achieve state-of-the-art performance for its size (136M parameters).

馃殌 What鈥檚 New in Version 2.4?

Version 2.4 is not just a minor update; it's a complete refinement of the model's behavior and alignment:

  • Advanced Token Density: v2.4 has been pushed to a total of 3.27 Billion tokens, ensuring the model has reached peak saturation for its 136M architecture.
  • Structural Alignment: Unlike previous iterations, 2.4 is natively aligned to the <|instruction|> and <|assistant|> tokens. The model now treats these as fundamental structural boundaries.
  • Hard-Coded EOS Logic: We have fixed the termination issues from earlier versions. v2.4 is specifically trained to predict and emit the <|eos|> token at the precise end of every instruction and response block, ensuring clean and reliable chat sessions.
  • Improved Hebrew Fluency: v2.4 leverages the DictaLM-3.0-24B tokenizer logic more effectively, resulting in a more natural "flow" of the Hebrew language without the stuttering found in smaller models.

馃専 Technical Highlights

  • Model Version: 2.4 (Instruct)
  • Parameter Count: 136M
  • Training Scale: 3.27B Tokens (Mixed C4 Hebrew/English)
  • Architecture: Optimized Transformer with RoPE and RMSNorm.
  • Inference Speed: Ultra-low latency, ideal for real-time bilingual applications.

馃捇 Implementation (v2.4)

To utilize the improved logic of v2.4, ensure you use trust_remote_code=True and follow the mandatory format.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer

# 转讬拽讜谉 讛讗讬讜转 诇-Instruct (讛-r 诇驻谞讬 讛-u)
model_id = "razielAI/Hoopoe-2.4-Instruct" 

print(f"讟讜注谉 讗转 讛诪讜讚诇 讛爪讬讘讜专讬 {model_id}... 谞讗 诇讛诪转讬谉.")

try:
    # 讟注讬谞转 讛讟讜拽谞讬讬讝专
    tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)

    # 讟注讬谞转 讛诪讜讚诇
    model = AutoModelForCausalLM.from_pretrained(
        model_id,
        torch_dtype=torch.bfloat16,
        device_map="auto",
        trust_remote_code=True
    )

    # 住谞讻专讜谉 讙讜讚诇 讛-Vocab
    if model.get_input_embeddings().weight.shape[0] != len(tokenizer):
        model.resize_token_embeddings(len(tokenizer))

    streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=False)

    def run_chat():
        print(f"\n--- {model_id} Chat Ready ---")
        model.eval()
        while True:
            user_input = input("\n馃懁 诪砖转诪砖: ")
            if user_input.lower() in ["exit", "quit", "讬爪讬讗讛", "讘讬讬"]:
                break

            prompt = f"<|instruction|>{user_input}<|eos|><|assistant|>"
            inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)

            print("馃 Hoopoe: ", end="")
            with torch.no_grad():
                model.generate(
                    input_ids=inputs["input_ids"],
                    attention_mask=inputs["attention_mask"],
                    max_new_tokens=512,
                    temperature=0.7,
                    do_sample=True,
                    pad_token_id=tokenizer.eos_token_id,
                    eos_token_id=tokenizer.eos_token_id,
                    repetition_penalty=1.15,
                    streamer=streamer
                )
            print()

    if __name__ == "__main__":
        run_chat()

except Exception as e:
    print(f"\n砖讙讬讗讛 讘讟注讬谞讛: {e}")
    print("\n注爪讛: 讻谞住 诇讚祝 讛诪讜讚诇 讘-Hugging Face 讜转讜讜讚讗 砖砖诐 讛诪砖转诪砖 讜讛诪讜讚诇 讻转讜讘讬诐 讘讚讬讜拽 讻讱.")
Downloads last month
35
Safetensors
Model size
0.1B params
Tensor type
BF16
Inference Providers NEW
This model isn't deployed by any Inference Provider. 馃檵 Ask for provider support

Model tree for razielAI/Hoopoe-2.4-Instruct

Finetuned
(8)
this model