Triangle104
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -18,6 +18,106 @@ tags:
|
|
18 |
This model was converted to GGUF format from [`prithivMLmods/Phi-4-QwQ`](https://huggingface.co/prithivMLmods/Phi-4-QwQ) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
|
19 |
Refer to the [original model card](https://huggingface.co/prithivMLmods/Phi-4-QwQ) for more details on the model.
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
## Use with llama.cpp
|
22 |
Install llama.cpp through brew (works on Mac and Linux)
|
23 |
|
|
|
18 |
This model was converted to GGUF format from [`prithivMLmods/Phi-4-QwQ`](https://huggingface.co/prithivMLmods/Phi-4-QwQ) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
|
19 |
Refer to the [original model card](https://huggingface.co/prithivMLmods/Phi-4-QwQ) for more details on the model.
|
20 |
|
21 |
+
---
|
22 |
+
[Phi-4-QwQ finetuned] from Microsoft's Phi-4 is a state-of-the-art open model developed with a focus on responsible problem solving and advanced reasoning capabilities. Built upon a diverse blend of synthetic datasets, carefully filtered public domain websites, and high-quality academic books and Q&A datasets, Phi-4-QwQ ensures that small, capable models are trained with datasets of exceptional depth and precision.
|
23 |
+
|
24 |
+
Phi-4-QwQ adopts a robust safety post-training approach using open-source and in-house synthetic datasets. This involves a combination of SFT (Supervised Fine-Tuning) and iterative DPO (Direct Preference Optimization) techniques, ensuring helpful and harmless outputs across various safety categories.
|
25 |
+
Dataset Info
|
26 |
+
|
27 |
+
Phi-4-QwQ is fine-tuned on a carefully curated synthetic dataset generated using an advanced pipeline optimized for Chain of Thought (CoT) reasoning and Responsible Problem Breakdown (RPB) methodologies. This ensures that the model excels at:
|
28 |
+
|
29 |
+
Logical reasoning
|
30 |
+
Step-by-step problem-solving
|
31 |
+
Breaking down complex tasks into manageable parts
|
32 |
+
|
33 |
+
The dataset also emphasizes responsible decision-making and fairness in generating solutions.
|
34 |
+
Run with Transformers
|
35 |
+
|
36 |
+
# pip install accelerate
|
37 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
38 |
+
import torch
|
39 |
+
|
40 |
+
tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/Phi-4-QwQ")
|
41 |
+
model = AutoModelForCausalLM.from_pretrained(
|
42 |
+
"prithivMLmods/Phi-4-QwQ",
|
43 |
+
device_map="auto",
|
44 |
+
torch_dtype=torch.bfloat16,
|
45 |
+
)
|
46 |
+
|
47 |
+
input_text = "Explain the concept of black holes."
|
48 |
+
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
|
49 |
+
|
50 |
+
outputs = model.generate(**input_ids, max_new_tokens=64)
|
51 |
+
print(tokenizer.decode(outputs[0]))
|
52 |
+
|
53 |
+
For chat-style interactions, use tokenizer.apply_chat_template:
|
54 |
+
|
55 |
+
messages = [
|
56 |
+
{"role": "user", "content": "Explain the concept of black holes."},
|
57 |
+
]
|
58 |
+
input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True).to("cuda")
|
59 |
+
|
60 |
+
outputs = model.generate(**input_ids, max_new_tokens=256)
|
61 |
+
print(tokenizer.decode(outputs[0]))
|
62 |
+
|
63 |
+
Intended Use
|
64 |
+
|
65 |
+
Phi-4-QwQ is tailored for a wide range of applications, especially those involving advanced reasoning, multilingual capabilities, and responsible problem-solving. Its primary use cases include:
|
66 |
+
|
67 |
+
Responsible Problem Solving
|
68 |
+
Breaking down complex problems into logical, actionable steps.
|
69 |
+
Offering ethical, well-rounded solutions in academic and professional contexts.
|
70 |
+
|
71 |
+
Advanced Reasoning Tasks
|
72 |
+
Excelling in mathematics, logic, and scientific reasoning.
|
73 |
+
Providing detailed explanations and systematic answers.
|
74 |
+
|
75 |
+
Content Generation
|
76 |
+
Assisting in generating high-quality content for various domains, including creative writing and technical documentation.
|
77 |
+
Supporting marketers, writers, and educators with detailed and well-structured outputs.
|
78 |
+
|
79 |
+
Educational Support
|
80 |
+
Acting as a virtual tutor for students by generating practice questions, answers, and detailed explanations.
|
81 |
+
Helping educators design learning material that promotes critical thinking and step-by-step problem-solving.
|
82 |
+
|
83 |
+
Customer Support & Dialogue Systems
|
84 |
+
Enabling chatbots and virtual assistants to provide accurate, helpful, and responsible responses.
|
85 |
+
Enhancing customer service with reasoning-driven automation.
|
86 |
+
|
87 |
+
Multilingual Capabilities
|
88 |
+
Supporting multilingual communication and content generation while maintaining contextual accuracy.
|
89 |
+
Assisting in translations with a focus on retaining meaning and nuance.
|
90 |
+
|
91 |
+
Safety-Critical Applications
|
92 |
+
Ensuring safe and harmless outputs, making it suitable for sensitive domains.
|
93 |
+
Providing aligned interactions with human oversight for critical systems.
|
94 |
+
|
95 |
+
Limitations
|
96 |
+
|
97 |
+
Despite its strengths, Phi-4-QwQ has some limitations that users should be aware of:
|
98 |
+
|
99 |
+
Bias and Fairness
|
100 |
+
While great effort has been made to minimize biases, users should critically assess the model’s output in sensitive scenarios to avoid unintended bias.
|
101 |
+
|
102 |
+
Contextual Interpretation
|
103 |
+
The model may occasionally misinterpret highly nuanced prompts or ambiguous contexts, leading to suboptimal responses.
|
104 |
+
|
105 |
+
Knowledge Cutoff
|
106 |
+
Phi-4-QwQ’s knowledge is static and based on the data available at the time of training. It does not include real-time updates or information on recent developments.
|
107 |
+
|
108 |
+
Safety and Harmlessness
|
109 |
+
Despite post-training safety alignment, inappropriate or harmful outputs may still occur. Continuous monitoring and human oversight are advised when using the model in critical contexts.
|
110 |
+
|
111 |
+
Computational Requirements
|
112 |
+
Deploying Phi-4-QwQ efficiently may require substantial computational resources, particularly for large-scale deployments or real-time applications.
|
113 |
+
|
114 |
+
Ethical Considerations
|
115 |
+
Users are responsible for ensuring that the model is not employed for malicious purposes, such as spreading misinformation, generating harmful content, or facilitating unethical behavior.
|
116 |
+
|
117 |
+
Domain-Specific Expertise
|
118 |
+
While the model is versatile, it may not perform optimally in highly specialized domains (e.g., law, medicine, finance) without further domain-specific fine-tuning.
|
119 |
+
|
120 |
+
---
|
121 |
## Use with llama.cpp
|
122 |
Install llama.cpp through brew (works on Mac and Linux)
|
123 |
|