Instructions to use erfanzar/LGeM-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use erfanzar/LGeM-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="erfanzar/LGeM-7B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("erfanzar/LGeM-7B") model = AutoModelForCausalLM.from_pretrained("erfanzar/LGeM-7B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use erfanzar/LGeM-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "erfanzar/LGeM-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "erfanzar/LGeM-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/erfanzar/LGeM-7B
- SGLang
How to use erfanzar/LGeM-7B 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 "erfanzar/LGeM-7B" \ --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": "erfanzar/LGeM-7B", "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 "erfanzar/LGeM-7B" \ --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": "erfanzar/LGeM-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use erfanzar/LGeM-7B with Docker Model Runner:
docker model run hf.co/erfanzar/LGeM-7B
Commit History
-
Update README.md
33911a3
-
Update README.md
276ecc3 -
Update README.md
4037b3a -
Update README.md
9abe82b -
Update README.md
### LGeM 🚀 - what is LGeM, LGeM is a CausalLM Model that is trained on self instruct data (Alpaca data), and for initialization of the first train of main model (weights are available) I used pre-weights from Alpaca LoRA (open source) - it's Decoder Only - built-in Pytorch - you can simply import models like ```python from modules import LGeMForCausalLM ``` - and Training code is available at LGeM-Train.py (check source) - training parameters - - learning rate 1e-4 - - AdamW (weight decay 1e-2) - - batch 2 - - A 100 80GB used for training (4 X ) ``` shell python3 LGeM-train.py ``` I used Alpaca Prompting Method ```python def prompt_to_instruction(instruction, input_=None, response_=None, eos='<|endoftext|>'): if input_ is None: st1_prompting = f'Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n\n{instruction}\n\n' else: st1_prompting = f'Below is an instruction that describ…aeaaba8 -
Upload Model with DPC INIT
e1764d1 -
Adding Tokenizer INIT
a6ee9ad -
Upload LlamaForCausalLM
0fa3051 -
initial commit
e55f57d