Instructions to use FirstPotatoCoder/KhmerLLM_full with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FirstPotatoCoder/KhmerLLM_full with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FirstPotatoCoder/KhmerLLM_full") 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("FirstPotatoCoder/KhmerLLM_full") model = AutoModelForCausalLM.from_pretrained("FirstPotatoCoder/KhmerLLM_full", 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 FirstPotatoCoder/KhmerLLM_full with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FirstPotatoCoder/KhmerLLM_full" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FirstPotatoCoder/KhmerLLM_full", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FirstPotatoCoder/KhmerLLM_full
- SGLang
How to use FirstPotatoCoder/KhmerLLM_full 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 "FirstPotatoCoder/KhmerLLM_full" \ --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": "FirstPotatoCoder/KhmerLLM_full", "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 "FirstPotatoCoder/KhmerLLM_full" \ --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": "FirstPotatoCoder/KhmerLLM_full", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FirstPotatoCoder/KhmerLLM_full with Docker Model Runner:
docker model run hf.co/FirstPotatoCoder/KhmerLLM_full
Download losses.json from FirstPotatoCoder/KhmerLLM_full: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/FirstPotatoCoder/KhmerLLM_full/resolve/main/losses.json
- Command line
-
hf download hf://FirstPotatoCoder/KhmerLLM_full/losses.json
-
curl -L -o losses.json https://huggingface.co/FirstPotatoCoder/KhmerLLM_full/resolve/main/losses.json
1.35 kB
| { | |
| "epoch_1": { | |
| "train": [ | |
| 12.986456871032715, | |
| 8.242310097591936, | |
| 6.103185503936011, | |
| 4.625102449842721, | |
| 4.073614676530696, | |
| 5.594025807735348, | |
| 3.14445710261006, | |
| 2.8427582374289018, | |
| 2.6573131159317396, | |
| 2.5581798939665488, | |
| 2.487692332070721, | |
| 2.4221809978327475, | |
| 2.3744151996186944, | |
| 2.3369295461118713, | |
| 2.2947631965984, | |
| 2.2793206945923736, | |
| 2.235823899064182, | |
| 2.202956847711043, | |
| 2.1905788616700606, | |
| 2.1760405711891235, | |
| 2.147873802815587, | |
| 2.1373383323023143, | |
| 2.115493049109278, | |
| 2.093070942508288, | |
| 2.069805771457262, | |
| 2.071623833317402, | |
| 2.041620403281913, | |
| 2.0338821135276604, | |
| 2.027073261363447, | |
| 2.0037578815271044, | |
| 1.9955629202945173, | |
| 1.9807603455772085, | |
| 1.9763815410866226, | |
| 1.9703653786793227, | |
| 1.9624102986548557, | |
| 1.9408840425743545, | |
| 1.9266109708912116, | |
| 1.936342299477128, | |
| 1.9150524722643134, | |
| 1.9088118700941732, | |
| 1.9036740681356634, | |
| 1.878493307641715, | |
| 1.880729602585154, | |
| 1.8804447402638838, | |
| 1.8716453221218645, | |
| 1.8813945673713999, | |
| 1.8745401167672529, | |
| 1.8709548193561145, | |
| 1.8608385588511949, | |
| 1.8541411072754663, | |
| 1.8461788908509182 | |
| ] | |
| } | |
| } |