Text Generation
Transformers
Safetensors
lfm3
liquid
edge
conversational
custom-code
weight-edited
custom_code
Instructions to use cbert33/LFM3-1.7B-UtilityModel-edited-weights with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cbert33/LFM3-1.7B-UtilityModel-edited-weights with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cbert33/LFM3-1.7B-UtilityModel-edited-weights", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cbert33/LFM3-1.7B-UtilityModel-edited-weights", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("cbert33/LFM3-1.7B-UtilityModel-edited-weights", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cbert33/LFM3-1.7B-UtilityModel-edited-weights with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cbert33/LFM3-1.7B-UtilityModel-edited-weights" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cbert33/LFM3-1.7B-UtilityModel-edited-weights", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cbert33/LFM3-1.7B-UtilityModel-edited-weights
- SGLang
How to use cbert33/LFM3-1.7B-UtilityModel-edited-weights 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 "cbert33/LFM3-1.7B-UtilityModel-edited-weights" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cbert33/LFM3-1.7B-UtilityModel-edited-weights", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "cbert33/LFM3-1.7B-UtilityModel-edited-weights" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cbert33/LFM3-1.7B-UtilityModel-edited-weights", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cbert33/LFM3-1.7B-UtilityModel-edited-weights with Docker Model Runner:
docker model run hf.co/cbert33/LFM3-1.7B-UtilityModel-edited-weights
Use the original LiquidAI baseline and the final census in the JSON table
Browse files
README.md
CHANGED
|
@@ -51,10 +51,14 @@ This is a weight-edited version of [LiquidAI/LFM3-1.7B](https://huggingface.co/L
|
|
| 51 |
|
| 52 |
| Metric | Baseline | Final | Delta |
|
| 53 |
|---|---:|---:|---:|
|
| 54 |
-
| pure JSON |
|
| 55 |
-
|
|
| 56 |
-
|
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
## Looping behavior
|
| 60 |
|
|
@@ -72,7 +76,6 @@ This is a weight-edited version of [LiquidAI/LFM3-1.7B](https://huggingface.co/L
|
|
| 72 |
| Metric | Baseline | Final | Delta |
|
| 73 |
|---|---:|---:|---:|
|
| 74 |
| ramble rate | 72.0% | 64.0% | -8.0 pts |
|
| 75 |
-
| median narration words | 693 | 508 | -185 |
|
| 76 |
| mean gen tokens | 2238 | 1951 | -12.8% |
|
| 77 |
|
| 78 |
## Files and reproducibility
|
|
|
|
| 51 |
|
| 52 |
| Metric | Baseline | Final | Delta |
|
| 53 |
|---|---:|---:|---:|
|
| 54 |
+
| pure JSON | 42.0% | 88.0% | +46.0 pts |
|
| 55 |
+
| pure antml | 20.0% | 0.0% | -20.0 pts |
|
| 56 |
+
| mixed | 26.7% | 0.0% | -26.7 pts |
|
| 57 |
+
| neither | 11.3% | 12.0% | +0.7 pts |
|
| 58 |
+
| parseable | 68.7% | 88.0% | +19.3 pts |
|
| 59 |
+
| antml present | 46.7% | 0.0% | -46.7 pts |
|
| 60 |
+
| mean gen tokens | 2008 | 1951 | -2.8% |
|
| 61 |
+
| prompts with >=1 parseable | 84% | 88% | +4 pts |
|
| 62 |
|
| 63 |
## Looping behavior
|
| 64 |
|
|
|
|
| 76 |
| Metric | Baseline | Final | Delta |
|
| 77 |
|---|---:|---:|---:|
|
| 78 |
| ramble rate | 72.0% | 64.0% | -8.0 pts |
|
|
|
|
| 79 |
| mean gen tokens | 2238 | 1951 | -12.8% |
|
| 80 |
|
| 81 |
## Files and reproducibility
|