Instructions to use StarpowerTechnology/WVY-Liquid-Recurrent-Depth with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use StarpowerTechnology/WVY-Liquid-Recurrent-Depth with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="StarpowerTechnology/WVY-Liquid-Recurrent-Depth")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("StarpowerTechnology/WVY-Liquid-Recurrent-Depth", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use StarpowerTechnology/WVY-Liquid-Recurrent-Depth with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "StarpowerTechnology/WVY-Liquid-Recurrent-Depth" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "StarpowerTechnology/WVY-Liquid-Recurrent-Depth", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/StarpowerTechnology/WVY-Liquid-Recurrent-Depth
- SGLang
How to use StarpowerTechnology/WVY-Liquid-Recurrent-Depth 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 "StarpowerTechnology/WVY-Liquid-Recurrent-Depth" \ --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": "StarpowerTechnology/WVY-Liquid-Recurrent-Depth", "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 "StarpowerTechnology/WVY-Liquid-Recurrent-Depth" \ --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": "StarpowerTechnology/WVY-Liquid-Recurrent-Depth", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use StarpowerTechnology/WVY-Liquid-Recurrent-Depth with Docker Model Runner:
docker model run hf.co/StarpowerTechnology/WVY-Liquid-Recurrent-Depth
Download src/wvy_experimental/data.py from StarpowerTechnology/WVY-Liquid-Recurrent-Depth: direct link, hf CLI and curl.
- Browser
- Download file 3.08 kB
-
https://huggingface.co/StarpowerTechnology/WVY-Liquid-Recurrent-Depth/resolve/main/src/wvy_experimental/data.py
- Command line
-
hf download hf://StarpowerTechnology/WVY-Liquid-Recurrent-Depth/src/wvy_experimental/data.py
-
curl -L -o data.py https://huggingface.co/StarpowerTechnology/WVY-Liquid-Recurrent-Depth/resolve/main/src/wvy_experimental/data.py
3.08 kB
| from __future__ import annotations | |
| import csv | |
| import json | |
| from collections.abc import Iterator | |
| from pathlib import Path | |
| SUPPORTED_EXTENSIONS = {".txt", ".md", ".jsonl", ".json", ".csv", ".parquet"} | |
| def discover_files(path: str | Path) -> list[Path]: | |
| root = Path(path).expanduser().resolve() | |
| if root.is_file(): | |
| files = [root] | |
| elif root.is_dir(): | |
| files = [item for item in root.rglob("*") if item.is_file()] | |
| else: | |
| raise FileNotFoundError(root) | |
| supported = sorted(item for item in files if item.suffix.lower() in SUPPORTED_EXTENSIONS) | |
| if not supported: | |
| raise ValueError(f"No supported data files found under {root}") | |
| return supported | |
| def iter_documents(files: list[Path], text_field: str = "text") -> Iterator[str]: | |
| for path in files: | |
| suffix = path.suffix.lower() | |
| if suffix in {".txt", ".md"}: | |
| text = path.read_text(encoding="utf-8", errors="replace") | |
| if text.strip(): | |
| yield text | |
| elif suffix == ".jsonl": | |
| with path.open("r", encoding="utf-8", errors="replace") as handle: | |
| for line_number, line in enumerate(handle, 1): | |
| if not line.strip(): | |
| continue | |
| value = json.loads(line) | |
| text = value.get(text_field) if isinstance(value, dict) else None | |
| if isinstance(text, str) and text.strip(): | |
| yield text | |
| elif text is None: | |
| raise ValueError(f"Missing string field {text_field!r} in {path}:{line_number}") | |
| elif suffix == ".json": | |
| value = json.loads(path.read_text(encoding="utf-8", errors="replace")) | |
| records = value if isinstance(value, list) else [value] | |
| for index, record in enumerate(records): | |
| text = record.get(text_field) if isinstance(record, dict) else None | |
| if isinstance(text, str) and text.strip(): | |
| yield text | |
| elif text is None: | |
| raise ValueError(f"Missing string field {text_field!r} in {path}, record {index}") | |
| elif suffix == ".csv": | |
| with path.open("r", encoding="utf-8", errors="replace", newline="") as handle: | |
| for index, record in enumerate(csv.DictReader(handle), 2): | |
| text = record.get(text_field) | |
| if isinstance(text, str) and text.strip(): | |
| yield text | |
| elif text is None: | |
| raise ValueError(f"Missing field {text_field!r} in {path}:{index}") | |
| elif suffix == ".parquet": | |
| try: | |
| import pyarrow.parquet as pq | |
| except ImportError as error: | |
| raise RuntimeError("Parquet scanning requires pyarrow") from error | |
| table = pq.read_table(path, columns=[text_field]) | |
| for text in table[text_field].to_pylist(): | |
| if isinstance(text, str) and text.strip(): | |
| yield text | |