Instructions to use GSAI-ML/ReFusion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GSAI-ML/ReFusion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GSAI-ML/ReFusion", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GSAI-ML/ReFusion", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("GSAI-ML/ReFusion", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Local Apps Settings
- vLLM
How to use GSAI-ML/ReFusion with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GSAI-ML/ReFusion" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GSAI-ML/ReFusion", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GSAI-ML/ReFusion
- SGLang
How to use GSAI-ML/ReFusion 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 "GSAI-ML/ReFusion" \ --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": "GSAI-ML/ReFusion", "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 "GSAI-ML/ReFusion" \ --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": "GSAI-ML/ReFusion", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GSAI-ML/ReFusion with Docker Model Runner:
docker model run hf.co/GSAI-ML/ReFusion
Add `library_name: transformers` to metadata
This PR adds the library_name: transformers metadata tag to the model card.
Evidence from the Quickstart section clearly shows the model's compatibility with the transformers library, as it imports AutoTokenizer and AutoModelForCausalLM from transformers. The config.json also defines auto_map entries for transformers-compatible classes like Qwen3ForCausalLM.
Adding this tag enables the automated "how to use" widget on the Hugging Face Hub, providing users with a quick and convenient way to interact with the model.
Hi @nielsr , thanks for the suggestion regarding the library_name tag!
I have manually updated the README.md to include the library_name: transformers metadata.
However, I will close this PR without merging the code changes for two reasons:
- The change to the variable name (
cur_gen_pos_ids->cur_gen_blocks_pos_ids) is incorrect and would break the logic (or cause an undefined variable error). - The prompt modification introduces a Python syntax error (multi-line strings require triple quotes).
I appreciate the help with the metadata integration! Closing this now as the tag is live.