Text Generation
Transformers
Safetensors
PyTorch
Turkish
llama
legal
turkish
llama-3.1
fp8
bfloat16
mixed-precision
question-answering
fsdp-v2
distributed-training
conversational
text-generation-inference
Instructions to use newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes") model = AutoModelForCausalLM.from_pretrained("newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes
- SGLang
How to use newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes 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 "newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes" \ --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": "newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes", "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 "newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes" \ --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": "newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes with Docker Model Runner:
docker model run hf.co/newmindai/Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-4nodes
| { | |
| "base_model": "meta-llama/Llama-3.1-8B-Instruct", | |
| "dataset": "newmindai/euro_hpc-legal", | |
| "training_args": { | |
| "model_id": "meta-llama/Llama-3.1-8B-Instruct", | |
| "trust_remote_code": true, | |
| "dataset": "newmindai/euro_hpc-legal", | |
| "dataset_config": null, | |
| "split": "train", | |
| "format": "qa", | |
| "seq_len": 4096, | |
| "num_samples": null, | |
| "combine_configs": true, | |
| "output_dir": "./lama3.1_8b_rowwise_with_gw_hp_4nodes", | |
| "num_epochs": 1, | |
| "max_steps": 1000, | |
| "batch_size": 8, | |
| "gradient_accumulation_steps": 8, | |
| "lr": 2e-05, | |
| "weight_decay": 0.01, | |
| "adam_beta1": 0.9, | |
| "adam_beta2": 0.95, | |
| "adam_epsilon": 1e-08, | |
| "max_grad_norm": 1.0, | |
| "lr_scheduler_type": "cosine", | |
| "warmup_steps": 100, | |
| "warmup_ratio": 0.1, | |
| "dtype": "bf16", | |
| "fp8": true, | |
| "save_steps": 500, | |
| "save_total_limit": 2, | |
| "save_best_metric": "val_loss", | |
| "resume_from_checkpoint": null, | |
| "val_steps": 5, | |
| "val_samples": 1000, | |
| "val_batch_size": null, | |
| "eval_split": "test", | |
| "eval_samples": 1000, | |
| "run_final_eval": true, | |
| "logging_steps": 1, | |
| "log_file": "./lama3.1_8b_rowwise_with_gw_hp_4nodes/logs/training.log", | |
| "use_wandb": true, | |
| "wandb_entity": null, | |
| "use_tensorboard": false, | |
| "tensorboard_dir": null, | |
| "compile": false, | |
| "gradient_checkpointing": true, | |
| "seed": 100, | |
| "fsdp_cpu_offload": false, | |
| "enable_profiler": false, | |
| "profiler_output_dir": null, | |
| "profiler_wait_steps": 1, | |
| "profiler_warmup_steps": 1, | |
| "profiler_active_steps": 3, | |
| "profiler_repeat": 1, | |
| "profiler_record_shapes": false, | |
| "profiler_profile_memory": false, | |
| "profiler_with_stack": false, | |
| "profiler_with_flops": false, | |
| "profiler_with_modules": false, | |
| "profiler_print_summary": false, | |
| "enable_tf32": true, | |
| "disable_tf32": false, | |
| "cudnn_benchmark": true, | |
| "flash_attention": true, | |
| "memory_efficient_attention": true, | |
| "attn_implementation": "sdpa", | |
| "input_scaling_granularity": "axiswise", | |
| "input_dtype": "e4m3fn", | |
| "weight_scaling_granularity": "axiswise", | |
| "weight_dtype": "e4m3fn", | |
| "grad_output_scaling_granularity": "axiswise", | |
| "grad_output_dtype": "e4m3fn", | |
| "fp8_recipe": "rowwise_with_gw_hp" | |
| }, | |
| "checkpoint_type": "distributed_sharded" | |
| } |