Text Generation
Transformers
Safetensors
llama
knowledge graph
rag
gnn
conversational
custom_code
text-generation-inference
Instructions to use alfiannajih/g-retriever-resume-reviewer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alfiannajih/g-retriever-resume-reviewer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="alfiannajih/g-retriever-resume-reviewer", 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("alfiannajih/g-retriever-resume-reviewer", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("alfiannajih/g-retriever-resume-reviewer", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use alfiannajih/g-retriever-resume-reviewer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alfiannajih/g-retriever-resume-reviewer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alfiannajih/g-retriever-resume-reviewer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/alfiannajih/g-retriever-resume-reviewer
- SGLang
How to use alfiannajih/g-retriever-resume-reviewer 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 "alfiannajih/g-retriever-resume-reviewer" \ --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": "alfiannajih/g-retriever-resume-reviewer", "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 "alfiannajih/g-retriever-resume-reviewer" \ --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": "alfiannajih/g-retriever-resume-reviewer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use alfiannajih/g-retriever-resume-reviewer with Docker Model Runner:
docker model run hf.co/alfiannajih/g-retriever-resume-reviewer
File size: 1,042 Bytes
c3a8a48 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | from transformers import LlamaConfig
class GRetrieverConfig(LlamaConfig):
model_type = "llama"
def __init__(
self,
max_txt_len: int = 1024,
max_new_tokens: int = 256,
gnn_num_layers: int = 4,
gnn_in_dim: int = 768,
gnn_hidden_dim: int = 1024,
gnn_num_heads: int = 4,
gnn_dropout: int = 0,
bos_id: list = [128000, 128000, 128006, 882, 128007],
**kwargs
):
pretrained_config = LlamaConfig.from_pretrained("NousResearch/Hermes-3-Llama-3.1-8B")
pretrained_config.update(kwargs)
self.max_txt_len = max_txt_len
self.max_new_tokens = max_new_tokens
self.gnn_num_layers = gnn_num_layers
self.gnn_in_dim = gnn_in_dim
self.gnn_hidden_dim = gnn_hidden_dim
self.gnn_num_heads = gnn_num_heads
self.gnn_dropout = gnn_dropout
self.bos_id = bos_id
super().__init__(**pretrained_config.to_dict())
self.pad_token_id = pretrained_config.eos_token_id |