Instructions to use pere/flax-bart-nb-nn with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pere/flax-bart-nb-nn with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pere/flax-bart-nb-nn")# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("pere/flax-bart-nb-nn", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pere/flax-bart-nb-nn with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pere/flax-bart-nb-nn" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pere/flax-bart-nb-nn", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pere/flax-bart-nb-nn
- SGLang
How to use pere/flax-bart-nb-nn 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 "pere/flax-bart-nb-nn" \ --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": "pere/flax-bart-nb-nn", "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 "pere/flax-bart-nb-nn" \ --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": "pere/flax-bart-nb-nn", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use pere/flax-bart-nb-nn with Docker Model Runner:
docker model run hf.co/pere/flax-bart-nb-nn
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
RotoBART
Running the script
Script arguemnts
Available model config arguments from script:
encoder_layers
encoder_ffn_dim
decoder_layers
decoder_ffn_dim
d_model
vocab_size
max_position_embeddings
encoder_layerdrop
decoder_layerdrop
Training Arguments:
testing : only uses 1 batch, for testing the script
adafactor: will enable adafactor, removing the command will revert to Adam
grad_accum: what value for gradient accumulation to use, default is 4
use_bf16: convert the model to bf16
colab_tpu: if running on a colab TPU
use_wandb: log using Weights & Biases (via Tensorboard)
save_strategy: whether or not to save model checkpoints based on steps or epoch
python rotobart/run_dnlm_flax.py \
--output_dir rotobart_output \
--overwrite_output_dir \
--dataset_path rotobart/pile.py \
--model_name_or_path rotobart \
--tokenizer_name ./rotobart/vocab-2/the_pile.model \
--shuffle_buffer_size 1000 \
--do_train --do_eval \
--max_seq_length 1024 \
--encoder_layers 2 \
--decoder_layers 2 \
--per_device_train_batch_size 2 \
--per_device_eval_batch_size 2 \
--logging_steps 8 \
--num_train_steps 1000 \
--eval_steps 1000 \
--save_steps 1000 \
--save_strategy steps \
--num_eval_samples 100 \
--warmup_steps 30 \
--learning_rate 1e-4 \
--use_wandb \
--testing \
--use_bf16 \
--adafactor
alt
python3 run_dnlm_flax.py --output_dir rotobart_output --overwrite_output_dir --dataset_path pile.py --model_name_or_path rotobart --tokenizer_name vocab-2/the_pile.model --shuffle_buffer_size 1000 --do_train --do_eval --max_position_embeddings 2048 --max_seq_length 2048 --encoder_layers 6 --decoder_layers 6 --per_device_train_batch_size 1 --per_device_eval_batch_size 1 --logging_steps 100 --num_train_steps 50000 --eval_steps 2500 --save_steps 2500 --save_strategy steps --num_eval_samples 5000 --warmup_steps 5000 --learning_rate 1e-4 --use_wandb --use_bf16 --adafactor
- Downloads last month
- 4