Text Generation
Transformers
English
finetuning
lora
qlora
unsloth
gpu
distributed
Eval Results (legacy)
Instructions to use lilbablo/humigencev2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lilbablo/humigencev2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lilbablo/humigencev2")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("lilbablo/humigencev2", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use lilbablo/humigencev2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lilbablo/humigencev2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lilbablo/humigencev2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/lilbablo/humigencev2
- SGLang
How to use lilbablo/humigencev2 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 "lilbablo/humigencev2" \ --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": "lilbablo/humigencev2", "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 "lilbablo/humigencev2" \ --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": "lilbablo/humigencev2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio new
How to use lilbablo/humigencev2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for lilbablo/humigencev2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for lilbablo/humigencev2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for lilbablo/humigencev2 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="lilbablo/humigencev2", max_seq_length=2048, ) - Docker Model Runner
How to use lilbablo/humigencev2 with Docker Model Runner:
docker model run hf.co/lilbablo/humigencev2
| """ | |
| Custom error handling for Humigence training pipeline | |
| """ | |
| import torch | |
| import torch.distributed as dist | |
| from typing import Optional | |
| class HumigenceError(Exception): | |
| """Base exception for Humigence training errors""" | |
| def __init__(self, message: str, suggested_fix: Optional[str] = None): | |
| super().__init__(message) | |
| self.suggested_fix = suggested_fix | |
| class ConfigurationError(HumigenceError): | |
| """Configuration validation errors""" | |
| pass | |
| class DatasetError(HumigenceError): | |
| """Dataset loading and processing errors""" | |
| pass | |
| class ModelError(HumigenceError): | |
| """Model loading and setup errors""" | |
| pass | |
| class TrainingError(HumigenceError): | |
| """Training process errors""" | |
| pass | |
| class EvaluationError(HumigenceError): | |
| """Evaluation process errors""" | |
| pass | |
| class DistributedError(HumigenceError): | |
| """Distributed training errors""" | |
| pass | |
| def handle_cuda_error(error: Exception) -> HumigenceError: | |
| """Convert CUDA errors to HumigenceError with suggested fixes""" | |
| error_msg = str(error) | |
| if "out of memory" in error_msg.lower(): | |
| return TrainingError( | |
| "CUDA out of memory", | |
| "Reduce batch size or use gradient checkpointing" | |
| ) | |
| elif "illegal memory access" in error_msg.lower(): | |
| return DistributedError( | |
| "NCCL illegal memory access", | |
| "Reduce batch size or retry single-GPU mode" | |
| ) | |
| elif "device" in error_msg.lower() and "mismatch" in error_msg.lower(): | |
| return TrainingError( | |
| "Device mismatch detected", | |
| "Ensure all tensors are on the same device" | |
| ) | |
| else: | |
| return TrainingError(f"CUDA error: {error_msg}") | |
| def handle_distributed_error(error: Exception) -> HumigenceError: | |
| """Convert distributed training errors to HumigenceError""" | |
| error_msg = str(error) | |
| if "nccl" in error_msg.lower(): | |
| return DistributedError( | |
| "NCCL communication error", | |
| "Check network configuration or retry single-GPU mode" | |
| ) | |
| elif "process group" in error_msg.lower(): | |
| return DistributedError( | |
| "Process group initialization failed", | |
| "Check distributed setup or retry single-GPU mode" | |
| ) | |
| else: | |
| return DistributedError(f"Distributed training error: {error_msg}") | |
| def handle_model_error(error: Exception) -> HumigenceError: | |
| """Convert model-related errors to HumigenceError""" | |
| error_msg = str(error) | |
| if "out of memory" in error_msg.lower(): | |
| return ModelError( | |
| "Model loading out of memory", | |
| "Use smaller model or enable model sharding" | |
| ) | |
| elif "not found" in error_msg.lower(): | |
| return ModelError( | |
| "Model not found", | |
| "Check model name or download the model first" | |
| ) | |
| else: | |
| return ModelError(f"Model error: {error_msg}") | |
| def handle_dataset_error(error: Exception) -> HumigenceError: | |
| """Convert dataset-related errors to HumigenceError""" | |
| error_msg = str(error) | |
| if "not found" in error_msg.lower(): | |
| return DatasetError( | |
| "Dataset file not found", | |
| "Check dataset path and ensure file exists" | |
| ) | |
| elif "column" in error_msg.lower() and "not in" in error_msg.lower(): | |
| return DatasetError( | |
| "Dataset column mismatch", | |
| "Check dataset schema and column names" | |
| ) | |
| else: | |
| return DatasetError(f"Dataset error: {error_msg}") | |
| def clean_error_message(error: HumigenceError) -> str: | |
| """Create a clean error message with suggested fix""" | |
| message = f"❌ {error.__class__.__name__}: {error}" | |
| if error.suggested_fix: | |
| message += f"\n Suggested fix: {error.suggested_fix}" | |
| return message | |