Instructions to use qywu/membart-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use qywu/membart-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="qywu/membart-base")# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("qywu/membart-base", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use qywu/membart-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "qywu/membart-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qywu/membart-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/qywu/membart-base
- SGLang
How to use qywu/membart-base 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 "qywu/membart-base" \ --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": "qywu/membart-base", "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 "qywu/membart-base" \ --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": "qywu/membart-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use qywu/membart-base with Docker Model Runner:
docker model run hf.co/qywu/membart-base
Upload MemBartForConditionalGeneration
Browse files- config.json +38 -0
- generation_config.json +9 -0
- pytorch_model.bin +3 -0
config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_dropout": 0.0,
|
| 3 |
+
"activation_function": "gelu",
|
| 4 |
+
"add_bias_logits": false,
|
| 5 |
+
"add_final_layer_norm": false,
|
| 6 |
+
"architectures": [
|
| 7 |
+
"MemBartForConditionalGeneration"
|
| 8 |
+
],
|
| 9 |
+
"attention_dropout": 0.0,
|
| 10 |
+
"bos_token_id": 0,
|
| 11 |
+
"d_model": 768,
|
| 12 |
+
"decoder_attention_heads": 12,
|
| 13 |
+
"decoder_ffn_dim": 3072,
|
| 14 |
+
"decoder_layerdrop": 0.0,
|
| 15 |
+
"decoder_layers": 6,
|
| 16 |
+
"decoder_start_token_id": 2,
|
| 17 |
+
"dropout": 0.0,
|
| 18 |
+
"encoder_attention_heads": 12,
|
| 19 |
+
"encoder_ffn_dim": 3072,
|
| 20 |
+
"encoder_layerdrop": 0.0,
|
| 21 |
+
"encoder_layers": 6,
|
| 22 |
+
"eos_token_id": 2,
|
| 23 |
+
"forced_eos_token_id": 2,
|
| 24 |
+
"gradient_checkpointing": false,
|
| 25 |
+
"init_std": 0.01,
|
| 26 |
+
"is_encoder_decoder": true,
|
| 27 |
+
"max_position_embeddings": 1024,
|
| 28 |
+
"memory_len": 64,
|
| 29 |
+
"normalize_before": false,
|
| 30 |
+
"normalize_embedding": true,
|
| 31 |
+
"pad_token_id": 1,
|
| 32 |
+
"pretrained_name": "facebook/bart-base",
|
| 33 |
+
"scale_embedding": false,
|
| 34 |
+
"torch_dtype": "float32",
|
| 35 |
+
"transformers_version": "4.26.1",
|
| 36 |
+
"use_cache": true,
|
| 37 |
+
"vocab_size": 50265
|
| 38 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"decoder_start_token_id": 2,
|
| 5 |
+
"eos_token_id": 2,
|
| 6 |
+
"forced_eos_token_id": 2,
|
| 7 |
+
"pad_token_id": 1,
|
| 8 |
+
"transformers_version": "4.26.1"
|
| 9 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:25d6efa382789c73ba37a3dc3b9fc74100b88b22c011d8536a8c1730ba77fb96
|
| 3 |
+
size 730678521
|