Instructions to use anarlavrenov/lime-1b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anarlavrenov/lime-1b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="anarlavrenov/lime-1b-instruct", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("anarlavrenov/lime-1b-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use anarlavrenov/lime-1b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "anarlavrenov/lime-1b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anarlavrenov/lime-1b-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/anarlavrenov/lime-1b-instruct
- SGLang
How to use anarlavrenov/lime-1b-instruct 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 "anarlavrenov/lime-1b-instruct" \ --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": "anarlavrenov/lime-1b-instruct", "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 "anarlavrenov/lime-1b-instruct" \ --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": "anarlavrenov/lime-1b-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use anarlavrenov/lime-1b-instruct with Docker Model Runner:
docker model run hf.co/anarlavrenov/lime-1b-instruct
Add GenerationMixin to LIMEForCausalLM
Browse files- modeling_lime.py +2 -1
modeling_lime.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import torch
|
| 2 |
from torch import nn
|
| 3 |
from transformers import PreTrainedModel
|
|
|
|
| 4 |
from transformers.modeling_outputs import CausalLMOutputWithPast
|
| 5 |
from typing import Optional, Tuple, Union
|
| 6 |
from ukraine.research.transformer.transformer import Transformer
|
|
@@ -21,7 +22,7 @@ def make_norm(config: LIMEConfig):
|
|
| 21 |
return nn.RMSNorm(config.d_model)
|
| 22 |
|
| 23 |
|
| 24 |
-
class LIMEForCausalLM(PreTrainedModel):
|
| 25 |
config_class = LIMEConfig
|
| 26 |
base_model_prefix = "lime"
|
| 27 |
_tied_weights_keys = ["transformer.output_fc.weight"]
|
|
|
|
| 1 |
import torch
|
| 2 |
from torch import nn
|
| 3 |
from transformers import PreTrainedModel
|
| 4 |
+
from transformers.generation import GenerationMixin
|
| 5 |
from transformers.modeling_outputs import CausalLMOutputWithPast
|
| 6 |
from typing import Optional, Tuple, Union
|
| 7 |
from ukraine.research.transformer.transformer import Transformer
|
|
|
|
| 22 |
return nn.RMSNorm(config.d_model)
|
| 23 |
|
| 24 |
|
| 25 |
+
class LIMEForCausalLM(PreTrainedModel, GenerationMixin):
|
| 26 |
config_class = LIMEConfig
|
| 27 |
base_model_prefix = "lime"
|
| 28 |
_tied_weights_keys = ["transformer.output_fc.weight"]
|