Instructions to use AgentPublic/fabrique-reference-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AgentPublic/fabrique-reference-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AgentPublic/fabrique-reference-2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AgentPublic/fabrique-reference-2") model = AutoModelForCausalLM.from_pretrained("AgentPublic/fabrique-reference-2") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use AgentPublic/fabrique-reference-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AgentPublic/fabrique-reference-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AgentPublic/fabrique-reference-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AgentPublic/fabrique-reference-2
- SGLang
How to use AgentPublic/fabrique-reference-2 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 "AgentPublic/fabrique-reference-2" \ --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": "AgentPublic/fabrique-reference-2", "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 "AgentPublic/fabrique-reference-2" \ --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": "AgentPublic/fabrique-reference-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AgentPublic/fabrique-reference-2 with Docker Model Runner:
docker model run hf.co/AgentPublic/fabrique-reference-2
Upload 3 files
Browse filesadd prompt template files
- experience_prompt_template.jinja +10 -0
- expert_prompt_template.jinja +15 -0
- simple_prompt_template.jinja +10 -0
experience_prompt_template.jinja
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Mode expérience
|
| 2 |
+
|
| 3 |
+
Question soumise au service {% if institution %}{{institution}} {% endif %}: {{query}}
|
| 4 |
+
|
| 5 |
+
{% for chunk in experience_chunks %}
|
| 6 |
+
{{chunk.id_experience}} : {{chunk.description}}
|
| 7 |
+
{% endfor %}
|
| 8 |
+
|
| 9 |
+
###Réponse :
|
| 10 |
+
|
expert_prompt_template.jinja
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Mode expert
|
| 2 |
+
|
| 3 |
+
Expérience: {{query}}
|
| 4 |
+
|
| 5 |
+
Réponse: {{most_similar_experience}}
|
| 6 |
+
|
| 7 |
+
Fiches:
|
| 8 |
+
|
| 9 |
+
{% for chunk in sheet_chunks %}
|
| 10 |
+
{{chunk.url}} : {{chunk.title}} {% if chunk.context %}({{chunk.context}}){% endif %}
|
| 11 |
+
{{chunk.text}} {% if not loop.last %}{{"\n"}}{% endif %}
|
| 12 |
+
{% endfor %}
|
| 13 |
+
|
| 14 |
+
###Réponse :
|
| 15 |
+
|
simple_prompt_template.jinja
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Mode expérience
|
| 2 |
+
|
| 3 |
+
Question soumise au service {% if institution %}{{institution}} {% endif %}: {{query}}
|
| 4 |
+
|
| 5 |
+
{% if context or links %}{{"\n"}}
|
| 6 |
+
Prompt:{% if context %}{{context}}{% endif %}{% if links %}{{links}}{% endif %}
|
| 7 |
+
{% endif %}
|
| 8 |
+
|
| 9 |
+
###Réponse :
|
| 10 |
+
|