Text Generation
Transformers
Safetensors
English
Portuguese
llama
hf-inference
education
logic
math
low-resource
open-source
causal-lm
lxcorp
conversational
text-generation-inference
Instructions to use lxcorp/lambda-1v-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lxcorp/lambda-1v-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lxcorp/lambda-1v-1B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lxcorp/lambda-1v-1B") model = AutoModelForCausalLM.from_pretrained("lxcorp/lambda-1v-1B") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use lxcorp/lambda-1v-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lxcorp/lambda-1v-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lxcorp/lambda-1v-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lxcorp/lambda-1v-1B
- SGLang
How to use lxcorp/lambda-1v-1B 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 "lxcorp/lambda-1v-1B" \ --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": "lxcorp/lambda-1v-1B", "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 "lxcorp/lambda-1v-1B" \ --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": "lxcorp/lambda-1v-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lxcorp/lambda-1v-1B with Docker Model Runner:
docker model run hf.co/lxcorp/lambda-1v-1B
Upload folder using huggingface_hub
Browse files- adapter_config.json +2 -2
- adapter_model.safetensors +1 -1
- tokenizer_config.json +6 -0
- training_args.bin +1 -1
adapter_config.json
CHANGED
|
@@ -24,8 +24,8 @@
|
|
| 24 |
"rank_pattern": {},
|
| 25 |
"revision": null,
|
| 26 |
"target_modules": [
|
| 27 |
-
"
|
| 28 |
-
"
|
| 29 |
],
|
| 30 |
"task_type": "CAUSAL_LM",
|
| 31 |
"trainable_token_indices": null,
|
|
|
|
| 24 |
"rank_pattern": {},
|
| 25 |
"revision": null,
|
| 26 |
"target_modules": [
|
| 27 |
+
"v_proj",
|
| 28 |
+
"q_proj"
|
| 29 |
],
|
| 30 |
"task_type": "CAUSAL_LM",
|
| 31 |
"trainable_token_indices": null,
|
adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4517152
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0dd81c75b067d2db0fb1ad6d41dad57068d52db01d58fa6a523048e71c329338
|
| 3 |
size 4517152
|
tokenizer_config.json
CHANGED
|
@@ -34,11 +34,17 @@
|
|
| 34 |
"eos_token": "</s>",
|
| 35 |
"extra_special_tokens": {},
|
| 36 |
"legacy": false,
|
|
|
|
| 37 |
"model_max_length": 2048,
|
|
|
|
| 38 |
"pad_token": "</s>",
|
|
|
|
| 39 |
"padding_side": "right",
|
| 40 |
"sp_model_kwargs": {},
|
|
|
|
| 41 |
"tokenizer_class": "LlamaTokenizer",
|
|
|
|
|
|
|
| 42 |
"unk_token": "<unk>",
|
| 43 |
"use_default_system_prompt": false
|
| 44 |
}
|
|
|
|
| 34 |
"eos_token": "</s>",
|
| 35 |
"extra_special_tokens": {},
|
| 36 |
"legacy": false,
|
| 37 |
+
"max_length": 512,
|
| 38 |
"model_max_length": 2048,
|
| 39 |
+
"pad_to_multiple_of": null,
|
| 40 |
"pad_token": "</s>",
|
| 41 |
+
"pad_token_type_id": 0,
|
| 42 |
"padding_side": "right",
|
| 43 |
"sp_model_kwargs": {},
|
| 44 |
+
"stride": 0,
|
| 45 |
"tokenizer_class": "LlamaTokenizer",
|
| 46 |
+
"truncation_side": "right",
|
| 47 |
+
"truncation_strategy": "longest_first",
|
| 48 |
"unk_token": "<unk>",
|
| 49 |
"use_default_system_prompt": false
|
| 50 |
}
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5304
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5f6d5751b62ec3eb31f2251b1e2e76fe1f8e49e99cd910ca2a9f339b168cd59d
|
| 3 |
size 5304
|