Instructions to use medmac01/moroccan-qa-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use medmac01/moroccan-qa-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="medmac01/moroccan-qa-v2", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("medmac01/moroccan-qa-v2", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use medmac01/moroccan-qa-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "medmac01/moroccan-qa-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "medmac01/moroccan-qa-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/medmac01/moroccan-qa-v2
- SGLang
How to use medmac01/moroccan-qa-v2 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 "medmac01/moroccan-qa-v2" \ --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": "medmac01/moroccan-qa-v2", "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 "medmac01/moroccan-qa-v2" \ --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": "medmac01/moroccan-qa-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use medmac01/moroccan-qa-v2 with Docker Model Runner:
docker model run hf.co/medmac01/moroccan-qa-v2
Update config.json
Browse files- config.json +23 -6
config.json
CHANGED
|
@@ -1,14 +1,20 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"alibi": false,
|
| 3 |
"apply_residual_connection_post_layernorm": false,
|
|
|
|
| 4 |
"architectures": [
|
| 5 |
"RWForCausalLM"
|
| 6 |
],
|
|
|
|
| 7 |
"auto_map": {
|
| 8 |
-
"AutoConfig": "configuration_RW.RWConfig",
|
| 9 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
},
|
| 11 |
-
"attention_dropout": 0.0,
|
| 12 |
"bias": false,
|
| 13 |
"bos_token_id": 11,
|
| 14 |
"eos_token_id": 11,
|
|
@@ -21,8 +27,19 @@
|
|
| 21 |
"n_head": 71,
|
| 22 |
"n_layer": 32,
|
| 23 |
"parallel_attn": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
"torch_dtype": "bfloat16",
|
| 25 |
-
"transformers_version": "4.
|
| 26 |
-
"use_cache":
|
| 27 |
"vocab_size": 65024
|
| 28 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "tiiuae/falcon-7b-instruct",
|
| 3 |
"alibi": false,
|
| 4 |
"apply_residual_connection_post_layernorm": false,
|
| 5 |
+
"trust_remote_code": true,
|
| 6 |
"architectures": [
|
| 7 |
"RWForCausalLM"
|
| 8 |
],
|
| 9 |
+
"attention_dropout": 0.0,
|
| 10 |
"auto_map": {
|
| 11 |
+
"AutoConfig": "tiiuae/falcon-7b--configuration_RW.RWConfig",
|
| 12 |
+
"AutoModel": "tiiuae/falcon-7b--modelling_RW.RWModel",
|
| 13 |
+
"AutoModelForCausalLM": "tiiuae/falcon-7b--modelling_RW.RWForCausalLM",
|
| 14 |
+
"AutoModelForQuestionAnswering": "tiiuae/falcon-7b--modelling_RW.RWForQuestionAnswering",
|
| 15 |
+
"AutoModelForSequenceClassification": "tiiuae/falcon-7b--modelling_RW.RWForSequenceClassification",
|
| 16 |
+
"AutoModelForTokenClassification": "tiiuae/falcon-7b--modelling_RW.RWForTokenClassification"
|
| 17 |
},
|
|
|
|
| 18 |
"bias": false,
|
| 19 |
"bos_token_id": 11,
|
| 20 |
"eos_token_id": 11,
|
|
|
|
| 27 |
"n_head": 71,
|
| 28 |
"n_layer": 32,
|
| 29 |
"parallel_attn": true,
|
| 30 |
+
"quantization_config": {
|
| 31 |
+
"bnb_4bit_compute_dtype": "bfloat16",
|
| 32 |
+
"bnb_4bit_quant_type": "nf4",
|
| 33 |
+
"bnb_4bit_use_double_quant": true,
|
| 34 |
+
"llm_int8_enable_fp32_cpu_offload": false,
|
| 35 |
+
"llm_int8_has_fp16_weight": false,
|
| 36 |
+
"llm_int8_skip_modules": null,
|
| 37 |
+
"llm_int8_threshold": 6.0,
|
| 38 |
+
"load_in_4bit": true,
|
| 39 |
+
"load_in_8bit": false
|
| 40 |
+
},
|
| 41 |
"torch_dtype": "bfloat16",
|
| 42 |
+
"transformers_version": "4.31.0.dev0",
|
| 43 |
+
"use_cache": false,
|
| 44 |
"vocab_size": 65024
|
| 45 |
+
}
|