Text Generation
Transformers
Safetensors
GGUF
English
legal
dpdp
qwen
slm
vllm
unsloth
simpo
rslora
rag
bge
conversational
Instructions to use PRiyanshu0-1/DPDP-SSense with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PRiyanshu0-1/DPDP-SSense with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PRiyanshu0-1/DPDP-SSense")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("PRiyanshu0-1/DPDP-SSense", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use PRiyanshu0-1/DPDP-SSense with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf PRiyanshu0-1/DPDP-SSense:Q4_K_M # Run inference directly in the terminal: llama cli -hf PRiyanshu0-1/DPDP-SSense:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf PRiyanshu0-1/DPDP-SSense:Q4_K_M # Run inference directly in the terminal: llama cli -hf PRiyanshu0-1/DPDP-SSense:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf PRiyanshu0-1/DPDP-SSense:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf PRiyanshu0-1/DPDP-SSense:Q4_K_M
Use Docker
docker model run hf.co/PRiyanshu0-1/DPDP-SSense:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use PRiyanshu0-1/DPDP-SSense with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PRiyanshu0-1/DPDP-SSense" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PRiyanshu0-1/DPDP-SSense", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PRiyanshu0-1/DPDP-SSense:Q4_K_M
- SGLang
How to use PRiyanshu0-1/DPDP-SSense 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 "PRiyanshu0-1/DPDP-SSense" \ --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": "PRiyanshu0-1/DPDP-SSense", "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 "PRiyanshu0-1/DPDP-SSense" \ --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": "PRiyanshu0-1/DPDP-SSense", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use PRiyanshu0-1/DPDP-SSense with Ollama:
ollama run hf.co/PRiyanshu0-1/DPDP-SSense:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use PRiyanshu0-1/DPDP-SSense with Docker Model Runner:
docker model run hf.co/PRiyanshu0-1/DPDP-SSense:Q4_K_M
- Lemonade
How to use PRiyanshu0-1/DPDP-SSense with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull PRiyanshu0-1/DPDP-SSense:Q4_K_M
Run and chat with the model
lemonade run user.DPDP-SSense-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Download evals/path_resolver.py from PRiyanshu0-1/DPDP-SSense: direct link, hf CLI and curl.
- Browser
- Download file 8.44 kB
-
https://huggingface.co/PRiyanshu0-1/DPDP-SSense/resolve/main/evals/path_resolver.py
- Command line
-
hf download hf://PRiyanshu0-1/DPDP-SSense/evals/path_resolver.py
-
curl -L -o path_resolver.py https://huggingface.co/PRiyanshu0-1/DPDP-SSense/resolve/main/evals/path_resolver.py
8.44 kB
| #!/usr/bin/env python3 | |
| """ | |
| path_resolver.py β Deterministic POSIX Path Resolution for DPDP Eval Suite (Linux/DGX) | |
| Resolves relative paths consistently across arbitrary Linux working directories | |
| (repo root, ml/, ml/evals/, ml/scripts/, or Docker mount points). | |
| Hierarchy for resolving models & assets: | |
| 1. Direct Path relative to current process CWD. | |
| 2. Relative to `ml/evals/` (supports legacy `../models/...` args). | |
| 3. Relative to `ml/` root directory. | |
| 4. Relative to overall project root. | |
| 5. Direct lookup in `ml/models/<basename>`. | |
| """ | |
| import os | |
| import sys | |
| import json | |
| from pathlib import Path | |
| from typing import Optional, List, Union | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # DYNAMIC POSIX ROOT DISCOVERY | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| def _discover_ml_root() -> Path: | |
| """ | |
| Climbs the filesystem hierarchy from this file's realpath to locate `ml/`. | |
| Guarantees correct anchoring regardless of Linux symlinks or shell CWD. | |
| """ | |
| current = Path(__file__).resolve().parent | |
| while current != current.parent: | |
| if (current / "data-forge").is_dir() and (current / "evals").is_dir(): | |
| return current | |
| if (current / "ml" / "data-forge").is_dir(): | |
| return (current / "ml").resolve() | |
| current = current.parent | |
| # Standard POSIX fallback | |
| return Path(__file__).resolve().parent.parent | |
| _ML_DIR = _discover_ml_root() | |
| _EVALS_DIR = (_ML_DIR / "evals").resolve() | |
| _PROJECT_ROOT = _ML_DIR.parent.resolve() | |
| class Paths: | |
| """Single source of truth for all paths in the DPDP evaluation pipeline.""" | |
| # ββ Directory Anchors βββββββββββββββββββββββββββββββββββββββββββββββ | |
| PROJECT_ROOT: Path = _PROJECT_ROOT | |
| ML_DIR: Path = _ML_DIR | |
| EVALS_DIR: Path = _EVALS_DIR | |
| CORE_DIR: Path = _EVALS_DIR | |
| SUITES_DIR: Path = _EVALS_DIR / "suites" | |
| # ββ Benchmark Datasets ββββββββββββββββββββββββββββββββββββββββββββββ | |
| BENCHMARKS_DIR: Path = _EVALS_DIR / "benchmarks" | |
| CHATBOT_QA_BENCHMARK: Path = BENCHMARKS_DIR / "dpdp_chatbot_qa.json" | |
| RAG_TESTSET: Path = BENCHMARKS_DIR / "dpdp_rag_testset.json" | |
| REDTEAM_PROMPTS: Path = BENCHMARKS_DIR / "redteam_hallucination_prompts.json" | |
| SECURITY_SUITE: Path = BENCHMARKS_DIR / "security_adversarial_suite.json" | |
| # ββ Ground Truth Policies βββββββββββββββββββββββββββββββββββββββββββ | |
| HOLDOUT_DIR: Path = _EVALS_DIR / "holdout_policies" | |
| GROUND_TRUTH: Path = HOLDOUT_DIR / "ground_truth.json" | |
| # ββ Output Reports ββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| REPORTS_DIR: Path = _EVALS_DIR / "reports" | |
| # ββ Schema Contracts ββββββββββββββββββββββββββββββββββββββββββββββββ | |
| SCHEMA_PATH: Path = _PROJECT_ROOT / "libs" / "contracts" / "schemas" / "dpdp_schema.json" | |
| # ββ Knowledge Base & Vector Store βββββββββββββββββββββββββββββββββββ | |
| DATA_FORGE_DIR: Path = _ML_DIR / "data-forge" | |
| LAW_TEXT: Path = DATA_FORGE_DIR / "dpdp_act_and_rules_2025.txt" | |
| HYBRID_INDEX: Path = DATA_FORGE_DIR / "dpdp_hybrid_index.pkl" | |
| # ββ Models & Training Data ββββββββββββββββββββββββββββββββββββββββββ | |
| MODELS_DIR: Path = _ML_DIR / "models" | |
| TRAINING_DATA_DIR: Path = _ML_DIR / "slm-training" / "data" | |
| def ensure_reports_dir(cls) -> Path: | |
| """Ensures the reports directory exists with standard Linux permissions.""" | |
| cls.REPORTS_DIR.mkdir(parents=True, exist_ok=True) | |
| return cls.REPORTS_DIR | |
| def resolve_model_path(cls, model_arg: Optional[Union[str, Path]], default_name: str) -> Path: | |
| """ | |
| Resolves model paths across Linux environments using multi-tier fallback. | |
| Args: | |
| model_arg: User/CLI argument (e.g. '../models/audit-model-final' or 'audit-model-final') | |
| default_name: Default subdirectory under ml/models/ if model_arg is None | |
| """ | |
| target = str(model_arg).strip() if model_arg else default_name | |
| # If it's already an absolute path and exists, return immediately | |
| p = Path(target) | |
| if p.is_absolute() and p.exists(): | |
| return p.resolve() | |
| # Search candidates in strict order of resolution | |
| search_candidates = [ | |
| # 1. Relative to CWD | |
| (Path.cwd() / target).resolve(), | |
| # 2. Relative to ml/evals (supports legacy ../models/... calls) | |
| (cls.EVALS_DIR / target).resolve(), | |
| # 3. Relative to ml/ root | |
| (cls.ML_DIR / target).resolve(), | |
| # 4. Relative to project root | |
| (cls.PROJECT_ROOT / target).resolve(), | |
| # 5. Direct lookup in ml/models by target or basename | |
| (cls.MODELS_DIR / target).resolve(), | |
| (cls.MODELS_DIR / Path(target).name).resolve(), | |
| ] | |
| for candidate in search_candidates: | |
| if candidate.exists(): | |
| return candidate | |
| # Return default target under models dir if not found (downstream will report missing path) | |
| return (cls.MODELS_DIR / Path(target).name).resolve() | |
| def resolve_gguf_path(cls, dir_or_file: Union[str, Path]) -> Path: | |
| """ | |
| Auto-discovers .gguf quantized model files in Linux directories. | |
| Prioritizes Q4_K_M if multiple quantization formats exist. | |
| """ | |
| resolved_path = cls.resolve_model_path(dir_or_file, "chatbot-model-final-gguf") | |
| if resolved_path.is_file() and resolved_path.suffix.lower() == ".gguf": | |
| return resolved_path | |
| if resolved_path.is_dir(): | |
| ggufs = sorted(resolved_path.glob("*.gguf")) | |
| if not ggufs: | |
| raise FileNotFoundError( | |
| f"β No .gguf model files located in: {resolved_path}\n" | |
| f"Ensure model export completed successfully." | |
| ) | |
| # Prioritize standard Q4_K_M quantization | |
| q4_candidates = [g for g in ggufs if "Q4_K_M" in g.name.upper()] | |
| if len(q4_candidates) == 1: | |
| return q4_candidates[0].resolve() | |
| if len(ggufs) > 1: | |
| names = [g.name for g in ggufs] | |
| raise ValueError( | |
| f"β οΈ Multiple GGUF binaries found in {resolved_path}: {names}\n" | |
| f"Specify the exact file path." | |
| ) | |
| return ggufs[0].resolve() | |
| raise FileNotFoundError(f"β Model path does not exist on Linux host: {resolved_path}") | |
| def read_model_label(cls, model_path: Union[str, Path], fallback: str = "Qwen2.5-7B-SLM") -> str: | |
| """Extracts model metadata dynamically from HuggingFace config.json on Linux.""" | |
| target_dir = cls.resolve_model_path(model_path, "") | |
| if target_dir.is_file(): | |
| target_dir = target_dir.parent | |
| config_path = target_dir / "config.json" | |
| if config_path.exists(): | |
| try: | |
| with open(config_path, "r", encoding="utf-8") as f: | |
| config = json.load(f) | |
| for key in ["_name_or_path", "model_type", "architectures"]: | |
| if key in config and config[key]: | |
| val = config[key] | |
| if isinstance(val, list) and len(val) > 0: | |
| val = val[0] | |
| return str(val) | |
| except Exception: | |
| pass | |
| return Path(model_path).name if model_path else fallback |