Instructions to use AIhomeJP/home1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AIhomeJP/home1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AIhomeJP/home1", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("AIhomeJP/home1", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AIhomeJP/home1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AIhomeJP/home1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AIhomeJP/home1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AIhomeJP/home1
- SGLang
How to use AIhomeJP/home1 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 "AIhomeJP/home1" \ --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": "AIhomeJP/home1", "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 "AIhomeJP/home1" \ --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": "AIhomeJP/home1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AIhomeJP/home1 with Docker Model Runner:
docker model run hf.co/AIhomeJP/home1
GPT (AIhomeJP/home1)
GPT is a lightweight GPT-style causal language model with a recursive refinement mechanism built on top of standard Transformer blocks.
This model is implemented with custom Hugging Face-compatible code and requires trust_remote_code=True when loading.
Model Description
GPT extends a standard decoder-only Transformer by adding a recursive refinement stage:
- Standard Transformer layers process the sequence
- A refinement block iteratively improves hidden states
- A gating mechanism controls residual blending
Core update equation
Model Details
| Parameter | Value |
|---|---|
| Architecture | Decoder-only Transformer |
| Layers | 4 |
| Hidden size | 256 |
| Heads | 4 |
| Context length | 256 |
| Recursive steps | 2 |
Usage
Load Model
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"AIhomeJP/home1",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained("AIhomeJP/home1")
Generate Text
import torch
input_ids = tokenizer("Hello", return_tensors="pt").input_ids
# モデルを評価モードに設定
model.eval()
curr_ids = input_ids
with torch.no_grad():
for _ in range(10):
# 辞書形式で出力が返るため、ブラケットでアクセスします
outputs = model(curr_ids)
logits = outputs['logits'][:, -1, :]
# NaNエラーを回避するためargmaxを使用
next_id = torch.argmax(logits, dim=-1, keepdim=True)
curr_ids = torch.cat([curr_ids, next_id], dim=1)
print(tokenizer.decode(curr_ids[0]))
Training
This model was trained using a supervised fine-tuning (SFT) pipeline with a standard causal language modeling objective:
Implementation Notes
Weight Tying
The model shares weights between:
token_emb.weightlm_head.weight
This is explicitly defined via:
_tied_weights_keys = ["lm_head.weight"]
Limitations
- Small model size (limited generalization)
- No KV-cache (generation latency is higher)
- No advanced attention optimizations
- Experimental architecture
Requirements
pip install torch transformers
License
MIT License
Author
- summer
- Downloads last month
- 675