A Large Language Model-Driven Reward Design Framework via Dynamic Feedback for Reinforcement Learning
Paper โข 2410.14660 โข Published
How to use dogtooth/open-lm-3b-201701 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="dogtooth/open-lm-3b-201701", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("dogtooth/open-lm-3b-201701", trust_remote_code=True, dtype="auto")How to use dogtooth/open-lm-3b-201701 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "dogtooth/open-lm-3b-201701"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "dogtooth/open-lm-3b-201701",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/dogtooth/open-lm-3b-201701
How to use dogtooth/open-lm-3b-201701 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "dogtooth/open-lm-3b-201701" \
--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": "dogtooth/open-lm-3b-201701",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "dogtooth/open-lm-3b-201701" \
--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": "dogtooth/open-lm-3b-201701",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use dogtooth/open-lm-3b-201701 with Docker Model Runner:
docker model run hf.co/dogtooth/open-lm-3b-201701
This is a HuggingFace-format conversion of the Apple Open LM 3B oracle model trained with a knowledge cutoff of January 2017, from the TiC-LM (Time-Continual Language Modeling) project.
| Property | Value |
|---|---|
| Architecture | LLaMA-style (pre-norm, SwiGLU, RoPE) |
| Parameters | ~2.7B |
| Training tokens | 220B |
| Knowledge cutoff | January 2017 |
| Vocab size | 50,432 |
| Context length | 2,048 |
| Original format | Apple Open LM |
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"dogtooth/open-lm-3b-201701",
dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")
.pt checkpoint to a custom OpenLMForCausalLM format.trust_remote_code=True when loading.@article{jain2024ticlm,
title={Time-Continual Learning from a Streaming Language Model},
author={Jain, Ameya and Ramesh, Aakanksha and Li, Tianjian and others},
journal={arXiv preprint arXiv:2410.14660},
year={2024}
}