Text Generation
Transformers
Safetensors
French
llama_syncabel
BEL
retrieval
entity-retrieval
named-entity-disambiguation
entity-disambiguation
named-entity-linking
entity-linking
text2text-generation
biomedical
healthcare
synthetic-data
causal-lm
llm
conversational
custom_code
Eval Results (legacy)
Instructions to use Aremaki/SynCABEL_QUAERO_EMEA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Aremaki/SynCABEL_QUAERO_EMEA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Aremaki/SynCABEL_QUAERO_EMEA", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Aremaki/SynCABEL_QUAERO_EMEA", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Aremaki/SynCABEL_QUAERO_EMEA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Aremaki/SynCABEL_QUAERO_EMEA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Aremaki/SynCABEL_QUAERO_EMEA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Aremaki/SynCABEL_QUAERO_EMEA
- SGLang
How to use Aremaki/SynCABEL_QUAERO_EMEA 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 "Aremaki/SynCABEL_QUAERO_EMEA" \ --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": "Aremaki/SynCABEL_QUAERO_EMEA", "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 "Aremaki/SynCABEL_QUAERO_EMEA" \ --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": "Aremaki/SynCABEL_QUAERO_EMEA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Aremaki/SynCABEL_QUAERO_EMEA with Docker Model Runner:
docker model run hf.co/Aremaki/SynCABEL_QUAERO_EMEA
Download guided_inference.py from Aremaki/SynCABEL_QUAERO_EMEA: direct link, hf CLI and curl.
- Browser
- Download file 2.68 kB
-
https://huggingface.co/Aremaki/SynCABEL_QUAERO_EMEA/resolve/main/guided_inference.py
- Command line
-
hf download hf://Aremaki/SynCABEL_QUAERO_EMEA/guided_inference.py
-
curl -L -o guided_inference.py https://huggingface.co/Aremaki/SynCABEL_QUAERO_EMEA/resolve/main/guided_inference.py
2.68 kB
| def _get_tgt_lang_token_id(tokenizer): | |
| """Best-effort retrieval of target language token id from a HF tokenizer. | |
| Returns None when not available. | |
| """ | |
| # Some tokenizers (MBart, M2M, NLLB) expose `tgt_lang` and different ways to map to ids | |
| tgt = getattr(tokenizer, "tgt_lang", None) | |
| if not tgt: | |
| return None | |
| # Common mapping dict | |
| try: | |
| lang_code_to_id = getattr(tokenizer, "lang_code_to_id", None) | |
| if isinstance(lang_code_to_id, dict) and tgt in lang_code_to_id: | |
| return lang_code_to_id[tgt] | |
| except Exception: | |
| pass | |
| return None | |
| def get_prefix_allowed_tokens_fn( | |
| model, | |
| sources: list[str], | |
| prefix_templates: list[str], | |
| sem_groups: list[str], | |
| multiple_answers: bool = False, | |
| ): | |
| candidates_trie = model.candidate_trie # type: ignore | |
| sep_token_id = model.tokenizer.sep_token_id | |
| eos_token_id = model.tokenizer.eos_token_id | |
| pad_token_id = model.tokenizer.pad_token_id | |
| tgt_lang_id = _get_tgt_lang_token_id(model.tokenizer) | |
| prefix_templates = [model.tokenizer.encode(prefix) for prefix in prefix_templates] | |
| def prefix_allowed_tokens_fn(batch_id, sent): | |
| sent = sent.tolist() | |
| prefix = prefix_templates[batch_id] | |
| # Remove the prefix from the sent | |
| index_sep = sent.index(sep_token_id) | |
| sent = sent[index_sep + 1 :] | |
| # Check if the prefix is present | |
| prefix_len = len(prefix) | |
| if sent[:prefix_len] == prefix: | |
| sent = sent[prefix_len - 1 :] | |
| else: | |
| raise ValueError("Prefix not found in the generated sentence.") | |
| if len(sent) > 1 and sent[-1] in [eos_token_id, pad_token_id]: | |
| return [pad_token_id, eos_token_id] | |
| sem_group = sem_groups[batch_id] | |
| # Remove everything up to last sep_token_id and add prefix and tgt_lang_id | |
| if multiple_answers and sep_token_id in sent: | |
| sep_index = len(sent) - 1 - sent[::-1].index(sep_token_id) | |
| if sep_index == len(sent) - 1: | |
| # Start fresh with decoder start (and optional tgt language token) | |
| sent = [prefix[-1]] + ([tgt_lang_id] if tgt_lang_id is not None else []) | |
| else: | |
| sent = ( | |
| [prefix[-1]] | |
| + ([tgt_lang_id] if tgt_lang_id is not None else []) | |
| + sent[sep_index + 1 :] | |
| ) | |
| trie_out = candidates_trie[ | |
| sem_group # type: ignore | |
| ].get(sent) | |
| if multiple_answers and eos_token_id in trie_out: | |
| trie_out = [sep_token_id] + trie_out | |
| return trie_out | |
| return prefix_allowed_tokens_fn | |