Text Generation
Transformers
Safetensors
English
ivme
language-model
transformer
rope
swiglu
muon
from-scratch
tiny
small
decoder-only
custom_code
Instructions to use IvmeLabs/Ivme-Conversate-v2-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IvmeLabs/Ivme-Conversate-v2-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IvmeLabs/Ivme-Conversate-v2-Base", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("IvmeLabs/Ivme-Conversate-v2-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IvmeLabs/Ivme-Conversate-v2-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IvmeLabs/Ivme-Conversate-v2-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IvmeLabs/Ivme-Conversate-v2-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/IvmeLabs/Ivme-Conversate-v2-Base
- SGLang
How to use IvmeLabs/Ivme-Conversate-v2-Base 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 "IvmeLabs/Ivme-Conversate-v2-Base" \ --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": "IvmeLabs/Ivme-Conversate-v2-Base", "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 "IvmeLabs/Ivme-Conversate-v2-Base" \ --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": "IvmeLabs/Ivme-Conversate-v2-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use IvmeLabs/Ivme-Conversate-v2-Base with Docker Model Runner:
docker model run hf.co/IvmeLabs/Ivme-Conversate-v2-Base
| #!/usr/bin/env python3 | |
| """ | |
| Runs lm-evaluation-harness against Ivme-Conversate-v2 using the ivme_lm.py adapter. | |
| Example: | |
| python run_eval.py \ | |
| --checkpoint /path/to/ckpt_final.pt \ | |
| --tokenizer /path/to/tokenizer.json \ | |
| --model_code_dir /path/to/model_folder \ | |
| --tasks wikitext,arc_easy,blimp \ | |
| --device cuda:0 \ | |
| --batch_size 16 | |
| Notes: | |
| - `--model_code_dir` should point at the folder containing the model/ package | |
| (config.py, transformer.py, etc.) -- i.e. what snapshot_download gave you, | |
| or wherever you cloned the repo. | |
| - `blimp` here means the actual harness BLiMP group task, which covers the | |
| real 67 paradigms with their real, correct config names on nyu-mll/blimp. | |
| This replaces the paradigm list in the old custom script, which had several | |
| fabricated/misspelled task names. | |
| - generate_until (free-form generation tasks) is not implemented in the | |
| adapter since this is a non-instruction-tuned base model -- stick to | |
| loglikelihood-based tasks (wikitext, arc_easy, blimp, hellaswag, piqa, etc.) | |
| """ | |
| import argparse | |
| import ivme_lm # noqa: F401 (registers the "ivme" model with lm_eval on import) | |
| import lm_eval | |
| from lm_eval.utils import make_table | |
| def main(): | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--checkpoint", type=str, required=True) | |
| parser.add_argument("--tokenizer", type=str, required=True) | |
| parser.add_argument("--model_code_dir", type=str, default="") | |
| parser.add_argument("--tasks", type=str, default="wikitext,arc_easy,blimp") | |
| parser.add_argument("--device", type=str, default="cuda:0") | |
| parser.add_argument("--batch_size", type=int, default=16) | |
| parser.add_argument("--limit", type=float, default=None, | |
| help="Optional: cap number of docs per task, for a quick sanity run first.") | |
| args = parser.parse_args() | |
| model_args = ( | |
| f"checkpoint={args.checkpoint}," | |
| f"tokenizer={args.tokenizer}," | |
| f"model_code_dir={args.model_code_dir}," | |
| f"device={args.device}," | |
| f"batch_size={args.batch_size}" | |
| ) | |
| results = lm_eval.simple_evaluate( | |
| model="ivme", | |
| model_args=model_args, | |
| tasks=args.tasks.split(","), | |
| limit=args.limit, | |
| ) | |
| print(make_table(results)) | |
| if "groups" in results and results["groups"]: | |
| print(make_table(results, "groups")) | |
| if __name__ == "__main__": | |
| main() | |