Text Generation
Transformers
PyTorch
English
French
mistral
conversational
text-generation-inference
Instructions to use paulml/Hermes-2-Pro-French with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use paulml/Hermes-2-Pro-French with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="paulml/Hermes-2-Pro-French") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("paulml/Hermes-2-Pro-French") model = AutoModelForCausalLM.from_pretrained("paulml/Hermes-2-Pro-French") 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 paulml/Hermes-2-Pro-French with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "paulml/Hermes-2-Pro-French" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "paulml/Hermes-2-Pro-French", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/paulml/Hermes-2-Pro-French
- SGLang
How to use paulml/Hermes-2-Pro-French 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 "paulml/Hermes-2-Pro-French" \ --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": "paulml/Hermes-2-Pro-French", "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 "paulml/Hermes-2-Pro-French" \ --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": "paulml/Hermes-2-Pro-French", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use paulml/Hermes-2-Pro-French with Docker Model Runner:
docker model run hf.co/paulml/Hermes-2-Pro-French
| { | |
| "<pad10>": 32010, | |
| "<pad11>": 32011, | |
| "<pad12>": 32012, | |
| "<pad13>": 32013, | |
| "<pad14>": 32014, | |
| "<pad15>": 32015, | |
| "<pad16>": 32016, | |
| "<pad17>": 32017, | |
| "<pad18>": 32018, | |
| "<pad19>": 32019, | |
| "<pad20>": 32020, | |
| "<pad21>": 32021, | |
| "<pad22>": 32022, | |
| "<pad23>": 32023, | |
| "<pad24>": 32024, | |
| "<pad25>": 32025, | |
| "<pad26>": 32026, | |
| "<pad27>": 32027, | |
| "<pad28>": 32028, | |
| "<pad29>": 32029, | |
| "<pad2>": 32002, | |
| "<pad30>": 32030, | |
| "<pad31>": 32031, | |
| "<pad3>": 32003, | |
| "<pad4>": 32004, | |
| "<pad5>": 32005, | |
| "<pad6>": 32006, | |
| "<pad7>": 32007, | |
| "<pad8>": 32008, | |
| "<pad9>": 32009, | |
| "<|im_end|>": 32000, | |
| "<|im_start|>": 32001 | |
| } | |