Text Generation
Transformers
Safetensors
French
English
llama
function-calling
sncf
trains
text-generation-inference
Instructions to use Skapersk/sncf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Skapersk/sncf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Skapersk/sncf")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Skapersk/sncf") model = AutoModelForCausalLM.from_pretrained("Skapersk/sncf") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Skapersk/sncf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Skapersk/sncf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Skapersk/sncf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Skapersk/sncf
- SGLang
How to use Skapersk/sncf 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 "Skapersk/sncf" \ --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": "Skapersk/sncf", "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 "Skapersk/sncf" \ --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": "Skapersk/sncf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Skapersk/sncf with Docker Model Runner:
docker model run hf.co/Skapersk/sncf
Fix pipeline_tag for inference API
Browse files
README.md
CHANGED
|
@@ -1,21 +1,35 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
-
-
|
| 5 |
-
- lora
|
| 6 |
- function-calling
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
-
# SNCF
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
##
|
| 14 |
|
| 15 |
```python
|
| 16 |
-
from peft import PeftModel
|
| 17 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 18 |
|
| 19 |
-
|
| 20 |
-
model =
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
pipeline_tag: text-generation
|
| 3 |
+
library_name: transformers
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
language:
|
| 6 |
+
- fr
|
| 7 |
+
- en
|
| 8 |
tags:
|
| 9 |
+
- llama
|
|
|
|
| 10 |
- function-calling
|
| 11 |
+
- sncf
|
| 12 |
+
- trains
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# SNCF Router Model
|
| 16 |
|
| 17 |
+
Ce modèle est un routeur d'outils intelligent pour la recherche de trains SNCF.
|
| 18 |
|
| 19 |
+
## Usage
|
| 20 |
|
| 21 |
```python
|
|
|
|
| 22 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 23 |
|
| 24 |
+
tokenizer = AutoTokenizer.from_pretrained("Skapersk/sncf")
|
| 25 |
+
model = AutoModelForCausalLM.from_pretrained("Skapersk/sncf")
|
| 26 |
+
|
| 27 |
+
prompt = "J'aimerais aller à Nantes, geoloc: Paris"
|
| 28 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 29 |
+
outputs = model.generate(**inputs, max_new_tokens=200)
|
| 30 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
## API d'inférence
|
| 34 |
+
|
| 35 |
+
Le modèle est compatible avec l'API d'inférence Hugging Face.
|