Jamie2205 commited on
Commit
244c8e2
·
verified ·
1 Parent(s): 908b629

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +22 -8
  2. app.py +39 -0
  3. requirements.txt +3 -0
README.md CHANGED
@@ -1,11 +1,25 @@
1
  ---
2
- datasets:
3
- - Liontix/claude-sonnet-4-100x
4
- - reedmayhew/claude-3.7-sonnet-reasoning
5
- base_model:
6
- - unsloth/Qwen3-4B-unsloth-bnb-4bit
 
7
  ---
8
- This model was trained on a Claude Sonnet 4 (non-reasoning) dataset and a Claude Sonnet 3.7 (reasoning) dataset. It is a reasoning model.
9
 
10
- If you want to fine-tune this model, then you can start from [here](https://huggingface.co/Liontix/Qwen3-8B-Gemini-2.5-Pro-Distill/blob/main/Unsloth_Qwen3_Reasoning_Conversational_Edited.ipynb), a slightly modified unsloth Jupyter notebook.
11
- Just make sure to change the base model to this `Liontix/Qwen3-4B-Claude-Sonnet-4-Reasoning-Distill-Safetensor` and also change the dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Qwen3-4B Claude Reasoning
3
+ emoji: 🧠
4
+ colorFrom: indigo
5
+ colorTo: pink
6
+ sdk: gradio
7
+ pinned: true
8
  ---
 
9
 
10
+ # Qwen3-4B Claude Sonnet Reasoning Distill (GGUF Q8_0)
11
+
12
+ This model was trained on a **Claude Sonnet 4 (non-reasoning)** dataset and a **Claude Sonnet 3.7 (reasoning)** dataset.
13
+
14
+ - 🧬 Datasets:
15
+ - `Liontix/claude-sonnet-4-100x`
16
+ - `reedmayhew/claude-3.7-sonnet-reasoning`
17
+
18
+ - 🏗 Base Model:
19
+ - `unsloth/Qwen3-4B-unsloth-bnb-4bit`
20
+
21
+ If you want to fine-tune this model:
22
+ - Start from: `Liontix/Qwen3-4B-Claude-Sonnet-4-Reasoning-Distill-Safetensor`
23
+ - Change dataset as needed in your training script or notebook
24
+
25
+ Prompt format uses Claude-style `<|im_start|>` / `<|im_end|>` markers with role tags.
app.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from huggingface_hub import hf_hub_download
3
+ from llama_cpp import Llama
4
+
5
+ REPO_ID = "mradermacher/Qwen3-4B-Claude-Sonnet-4-Reasoning-Distill-Safetensor-GGUF"
6
+ MODEL_FILENAME = "qwen3-4b-claude-sonnet-4-reasoning-distill.Q8_0.gguf"
7
+
8
+ model_path = hf_hub_download(
9
+ repo_id=REPO_ID,
10
+ filename=MODEL_FILENAME,
11
+ local_dir="/home/user/app/models"
12
+ )
13
+
14
+ llm = Llama(
15
+ model_path=model_path,
16
+ n_ctx=4096,
17
+ n_threads=4,
18
+ temperature=0.4,
19
+ repeat_penalty=1.1,
20
+ )
21
+
22
+ # Claude-style system/user/assistant formatted prompt
23
+ def generate_response(user_input):
24
+ prompt = (
25
+ "<|im_start|>system\nYou are a helpful assistant.\n<|im_end|>\n"
26
+ f"<|im_start|>user\n{user_input}<|im_end|>\n"
27
+ "<|im_start|>assistant\n"
28
+ ).format(user_input=user_input)
29
+
30
+ output = llm(prompt, max_tokens=512, stop=["<|im_end|>"])
31
+ return output["choices"][0]["text"]
32
+
33
+ gr.Interface(
34
+ fn=generate_response,
35
+ inputs=gr.Textbox(label="Prompt", lines=4),
36
+ outputs=gr.Textbox(label="Claude-Sonnet Response"),
37
+ title="Claude Reasoning Chat - Qwen3-4B",
38
+ description="Uses Claude-style system/user/assistant prompting with Qwen3-4B Reasoning Distill model."
39
+ ).launch()
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ gradio
2
+ huggingface_hub
3
+ llama-cpp-python==0.2.68