Download source/scripts/serve_ngram.py from khazic/spec-b300: direct link, hf CLI and curl.
- Browser
- Download file 454 Bytes
-
https://huggingface.co/khazic/spec-b300/resolve/main/source/scripts/serve_ngram.py
- Command line
-
hf download hf://khazic/spec-b300/source/scripts/serve_ngram.py
-
curl -L -o serve_ngram.py https://huggingface.co/khazic/spec-b300/resolve/main/source/scripts/serve_ngram.py
454 Bytes
| """Serve NGram-DFlash without changing the shared vLLM environment installation. | |
| Register at module scope so multiprocessing spawn workers also install the | |
| model and sampling hooks before constructing their runners. | |
| """ | |
| import os | |
| os.environ["VLLM_USE_V2_MODEL_RUNNER"] = "1" | |
| os.environ["VLLM_PLUGINS"] = "" | |
| from speculators.vllm.ngram import register | |
| register() | |
| if __name__ == "__main__": | |
| from vllm.entrypoints.cli.main import main | |
| main() | |