Text Generation
Transformers
PyTorch
Turkish
mt5
text2text-generation
question-generation
answer-extraction
question-answering
Instructions to use obss/mt5-small-3task-highlight-combined3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use obss/mt5-small-3task-highlight-combined3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="obss/mt5-small-3task-highlight-combined3")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("obss/mt5-small-3task-highlight-combined3") model = AutoModelForSeq2SeqLM.from_pretrained("obss/mt5-small-3task-highlight-combined3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use obss/mt5-small-3task-highlight-combined3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "obss/mt5-small-3task-highlight-combined3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "obss/mt5-small-3task-highlight-combined3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/obss/mt5-small-3task-highlight-combined3
- SGLang
How to use obss/mt5-small-3task-highlight-combined3 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 "obss/mt5-small-3task-highlight-combined3" \ --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": "obss/mt5-small-3task-highlight-combined3", "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 "obss/mt5-small-3task-highlight-combined3" \ --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": "obss/mt5-small-3task-highlight-combined3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use obss/mt5-small-3task-highlight-combined3 with Docker Model Runner:
docker model run hf.co/obss/mt5-small-3task-highlight-combined3
| _n_gpu: 1 | |
| adafactor: false | |
| adam_beta1: 0.9 | |
| adam_beta2: 0.999 | |
| adam_epsilon: 1.0e-08 | |
| cache_dir: null | |
| compute_metric_task_list: | |
| - question-generation | |
| - question-answering | |
| dataloader_drop_last: false | |
| dataloader_num_workers: 0 | |
| dataloader_pin_memory: true | |
| ddp_find_unused_parameters: null | |
| debug: [] | |
| deepspeed: null | |
| disable_tqdm: false | |
| do_eval: true | |
| do_predict: false | |
| do_train: true | |
| eval_accumulation_steps: 1 | |
| eval_steps: 2000 | |
| evaluation_strategy: &id001 !!python/object/apply:transformers.trainer_utils.IntervalStrategy | |
| - steps | |
| fp16: false | |
| fp16_backend: auto | |
| fp16_full_eval: false | |
| fp16_opt_level: O1 | |
| freeze_embeddings: false | |
| gradient_accumulation_steps: 1 | |
| greater_is_better: null | |
| group_by_length: false | |
| ignore_data_skip: false | |
| label_names: null | |
| label_smoothing: 0 | |
| label_smoothing_factor: 0.0 | |
| learning_rate: 0.0001 | |
| length_column_name: length | |
| load_best_model_at_end: false | |
| local_rank: -1 | |
| log_level: -1 | |
| log_level_replica: -1 | |
| log_on_each_node: true | |
| logging_dir: runs/exp10\runs\Jul10_02-34-34_DESKTOP-65UI233 | |
| logging_first_step: false | |
| logging_steps: 500 | |
| logging_strategy: | |
| lr_scheduler_type: !!python/object/apply:transformers.trainer_utils.SchedulerType | |
| - linear | |
| max_grad_norm: 1.0 | |
| max_source_length: 512 | |
| max_steps: -1 | |
| max_target_length: 64 | |
| metric_for_best_model: null | |
| model_name_or_path: google/mt5-small | |
| mp_parameters: '' | |
| neptune_api_token: null | |
| neptune_project: null | |
| no_cuda: false | |
| num_train_epochs: 15 | |
| output_dir: runs/exp10 | |
| overwrite_output_dir: false | |
| past_index: -1 | |
| per_device_eval_batch_size: 4 | |
| per_device_train_batch_size: 4 | |
| per_gpu_eval_batch_size: null | |
| per_gpu_train_batch_size: null | |
| prediction_loss_only: false | |
| prepare_data: true | |
| push_to_hub: false | |
| push_to_hub_model_id: exp10 | |
| push_to_hub_organization: null | |
| push_to_hub_token: null | |
| remove_unused_columns: false | |
| report_to: | |
| - wandb | |
| - neptune | |
| resume_from_checkpoint: null | |
| run_name: exp10 | |
| save_steps: 500 | |
| save_strategy: | |
| save_total_limit: 1 | |
| seed: 42 | |
| sharded_ddp: [] | |
| skip_memory_metrics: true | |
| tokenizer_path: mt5_small_tokenizer | |
| tpu_metrics_debug: false | |
| tpu_num_cores: null | |
| train_dataset_list: | |
| - tquad-train | |
| - tquad-valid | |
| - xquad.tr | |
| train_file_path: data/train_data_multitask_mt5.pt | |
| use_legacy_prediction_loop: false | |
| valid_dataset_list: | |
| - tquad-valid | |
| valid_file_path: data/valid_data_multitask_mt5.pt | |
| wandb_project: turkish-qa-qg | |
| warmup_ratio: 0.0 | |
| warmup_steps: 0 | |
| weight_decay: 0.0 | |