Instructions to use ysdede/Phi-4-mm-inst-asr-turkish with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ysdede/Phi-4-mm-inst-asr-turkish with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ysdede/Phi-4-mm-inst-asr-turkish", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ysdede/Phi-4-mm-inst-asr-turkish", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ysdede/Phi-4-mm-inst-asr-turkish with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ysdede/Phi-4-mm-inst-asr-turkish" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ysdede/Phi-4-mm-inst-asr-turkish", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ysdede/Phi-4-mm-inst-asr-turkish
- SGLang
How to use ysdede/Phi-4-mm-inst-asr-turkish 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 "ysdede/Phi-4-mm-inst-asr-turkish" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ysdede/Phi-4-mm-inst-asr-turkish", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ysdede/Phi-4-mm-inst-asr-turkish" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ysdede/Phi-4-mm-inst-asr-turkish", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ysdede/Phi-4-mm-inst-asr-turkish with Docker Model Runner:
docker model run hf.co/ysdede/Phi-4-mm-inst-asr-turkish
Phi-4-multimodal-instruct-asr-tr
This model is a fine-tuned version of microsoft/Phi-4-multimodal-instruct on a 600-hour Turkish audio dataset, trained for a single epoch because of resource constraints.
Trained with Prompt: "Transcribe the Turkish audio"
Including the source language during inference helps reduce hallucinations and improve accuracy, even with the base model. This model has been fine-tuned using the same prompt.
Training results
Evaluation Results:
- Before Fine-Tuning:
- WER: 127.29
- CER: 78.22
- After Fine-Tuning:
- WER: 47.57
- CER: 20.52
- Before Fine-Tuning:
Training Loss:
- Decreased from 1.423 to 0.176
Inference
Load generation_config and processor from the base model as a quick fix to use the default generation settings.
Note: The new models currently lack high-quality fine-tuning scripts. When saving a fine-tuned model using model.save_pretrained(), the processor configuration—including essential audio parameters—is not automatically saved. This omission can lead to errors during inference due to the model’s complex architecture. Loading these components from the base model ensures that all critical settings are properly included.
generation_config = GenerationConfig.from_pretrained(
'microsoft/Phi-4-multimodal-instruct', 'generation_config.json'
)
processor = AutoProcessor.from_pretrained(
'microsoft/Phi-4-multimodal-instruct', trust_remote_code=True
)
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 4
- eval_batch_size: 8
- seed: 42
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.95) and epsilon=1e-07 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 5000
- num_epochs: 1
- mixed_precision_training: Native AMP
Framework versions
- Transformers 4.46.1
- Pytorch 2.5.1+cu124
- Datasets 3.3.2
- Tokenizers 0.20.3
- Downloads last month
- 12
Model tree for ysdede/Phi-4-mm-inst-asr-turkish
Base model
microsoft/Phi-4-multimodal-instruct