--- license: mit license_link: https://huggingface.co/microsoft/phi-4/resolve/main/LICENSE language: - tr pipeline_tag: text-generation tags: - phi - nlp - instruction-tuning - turkish - chat - conversational inference: parameters: temperature: 0.7 widget: - messages: - role: user content: "Internet'i nasıl açıklayabilirim?" library_name: transformers --- # Phi-4 Turkish Instruction-Tuned Model This model is a fine-tuned version of Microsoft's **Phi-4** model for Turkish instruction-following tasks. It was trained on a **55,000-sample Turkish instruction dataset**, making it well-suited for generating helpful and coherent responses in Turkish. ## Model Summary | | | |-------------------------|-----------------------------------------------| | **Developers** | Baran Bingöl (Hugging Face: [barandinho](https://huggingface.co/barandinho)) | | **Base Model** | [microsoft/phi-4](https://huggingface.co/microsoft/phi-4) | | **Architecture** | 14B parameters, dense decoder-only Transformer| | **Training Data** | 55K Turkish instruction samples | | **Context Length** | 16K tokens | | **License** | MIT ([License Link](https://huggingface.co/microsoft/phi-4/resolve/main/LICENSE)) | ## Intended Use ### Primary Use Cases - Turkish conversational AI systems - Chatbots and virtual assistants - Educational tools for Turkish users - General-purpose text generation in Turkish ### Out-of-Scope Use Cases - High-risk domains (medical, legal, financial advice) without proper evaluation - Use in sensitive or safety-critical systems without safeguards ## Usage ### Input Formats Given the nature of the training data, `phi-4` is best suited for prompts using the chat format as follows: ```bash <|im_start|>system<|im_sep|> Sen yardımsever bir yapay zekasın.<|im_end|> <|im_start|>user<|im_sep|> Kuantum hesaplama neden önemlidir?<|im_end|> <|im_start|>assistant<|im_sep|> ``` ### With `transformers` ```python import transformers pipeline = transformers.pipeline( "text-generation", model="barandinho/phi4-turkish-instruct", model_kwargs={"torch_dtype": "auto"}, device_map="auto", ) messages = [ {"role": "system", "content": "Sen yardımsever bir yapay zekasın."}, {"role": "user", "content": "Kuantum hesaplama neden önemlidir?"}, ] outputs = pipeline(messages, max_new_tokens=128) print(outputs[0]["generated_text"][-1]) ```