Instructions to use Yewei-Liu/SHINE-ift_mqa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Yewei-Liu/SHINE-ift_mqa with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Yewei-Liu/SHINE-ift_mqa")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Yewei-Liu/SHINE-ift_mqa", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Yewei-Liu/SHINE-ift_mqa with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Yewei-Liu/SHINE-ift_mqa" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Yewei-Liu/SHINE-ift_mqa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Yewei-Liu/SHINE-ift_mqa
- SGLang
How to use Yewei-Liu/SHINE-ift_mqa 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 "Yewei-Liu/SHINE-ift_mqa" \ --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": "Yewei-Liu/SHINE-ift_mqa", "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 "Yewei-Liu/SHINE-ift_mqa" \ --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": "Yewei-Liu/SHINE-ift_mqa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Yewei-Liu/SHINE-ift_mqa with Docker Model Runner:
docker model run hf.co/Yewei-Liu/SHINE-ift_mqa
Add model card and link to paper
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# SHINE: A Scalable In-Context Hypernetwork for Mapping Context to LoRA in a Single Pass
|
| 7 |
+
|
| 8 |
+
SHINE (Scalable Hyper In-context NEtwork) is a scalable hypernetwork that can map diverse meaningful contexts into high-quality LoRA adapters for large language models (LLM) in a single forward pass.
|
| 9 |
+
|
| 10 |
+
- **Paper:** [SHINE: A Scalable In-Context Hypernetwork for Mapping Context to LoRA in a Single Pass](https://huggingface.co/papers/2602.06358)
|
| 11 |
+
- **Repository:** [https://github.com/Yewei-Liu/SHINE](https://github.com/Yewei-Liu/SHINE)
|
| 12 |
+
|
| 13 |
+
## Description
|
| 14 |
+
|
| 15 |
+
By reusing the frozen LLM's own parameters in an in-context hypernetwork design and introducing architectural innovations, SHINE overcomes key limitations of prior hypernetworks and achieves strong expressive power with a relatively small number of parameters. It updates LLM parameters without any fine-tuning, and immediately enables complex question answering tasks related to the context without directly accessing the context, effectively transforming in-context knowledge to in-parameter knowledge in one pass.
|
| 16 |
+
|
| 17 |
+
Compared to traditional SFT-based adaptation, SHINE significantly saves time, computation, and memory costs while showing great potential for scaling.
|
| 18 |
+
|
| 19 |
+
## Usage
|
| 20 |
+
|
| 21 |
+
For environment setup and detailed inference instructions, please refer to the [official GitHub repository](https://github.com/Yewei-Liu/SHINE). The project provides an `inference.ipynb` notebook to quickly test the hypernetwork's ability to generate LoRA adapters from custom contexts.
|
| 22 |
+
|
| 23 |
+
## Citation
|
| 24 |
+
|
| 25 |
+
```bibtex
|
| 26 |
+
@article{liu2025shine,
|
| 27 |
+
title={SHINE: A Scalable In-Context Hypernetwork for Mapping Context to LoRA in a Single Pass},
|
| 28 |
+
author={Liu, Yewei and others},
|
| 29 |
+
journal={arXiv preprint arXiv:2602.06358},
|
| 30 |
+
year={2025}
|
| 31 |
+
}
|
| 32 |
+
```
|