hiko1999 commited on
Commit
ea590a8
·
verified ·
1 Parent(s): e4ba3e3

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: microsoft/Phi-3.5-mini-instruct
3
+ library_name: peft
4
+ pipeline_tag: text-generation
5
+ license: cc-by-nc-sa-4.0
6
+ language:
7
+ - en
8
+ tags:
9
+ - lora
10
+ - qlora
11
+ - phi-3.5
12
+ - pc-assistant
13
+ - hardware
14
+ - troubleshooting
15
+ ---
16
+
17
+ # Phi-3.5-mini PC Assistant (English)
18
+
19
+ [中文](#中文) | [日本語](#日本語) | [English](#english)
20
+
21
+ ---
22
+
23
+ ## 中文
24
+
25
+ ### 简介
26
+ 这是一个基于 [microsoft/Phi-3.5-mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct) 微调的本地 PC 助手模型,专注于电脑硬件、软件故障排查和技术问答。
27
+
28
+ **当前版本仅支持英语输入输出。** 中文和日语支持正在开发中。
29
+
30
+ ### 使用方式
31
+ ```python
32
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
33
+ from peft import PeftModel
34
+ import torch
35
+
36
+ bnb_config = BitsAndBytesConfig(
37
+ load_in_4bit=True,
38
+ bnb_4bit_quant_type="nf4",
39
+ bnb_4bit_compute_dtype=torch.bfloat16,
40
+ )
41
+ base_model = AutoModelForCausalLM.from_pretrained(
42
+ "microsoft/Phi-3.5-mini-instruct",
43
+ quantization_config=bnb_config,
44
+ device_map="auto",
45
+ )
46
+ model = PeftModel.from_pretrained(base_model, "hiko1999/phi-3.5-mini-pc-assistant-en")
47
+ tokenizer = AutoTokenizer.from_pretrained("hiko1999/phi-3.5-mini-pc-assistant-en")
48
+
49
+ prompt = "<|user|>\nWhat is a GPU?<|end|>\n<|assistant|>\n"
50
+ inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
51
+ outputs = model.generate(**inputs, max_new_tokens=200, use_cache=False)
52
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
53
+ ```
54
+
55
+ ### 原始出处与许可证
56
+ | 项目 | 来源 | 许可证 |
57
+ |------|------|--------|
58
+ | 基础模型 | [microsoft/Phi-3.5-mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct) | MIT License |
59
+ | 训练数据集 | [kunishou/databricks-dolly-15k-ja](https://huggingface.co/datasets/kunishou/databricks-dolly-15k-ja)(原始:[databricks-dolly-15k](https://huggingface.co/datasets/databricks/databricks-dolly-15k)) | CC BY-SA 3.0 |
60
+
61
+ ### 本模型许可证
62
+ 本微调模型采用 **CC BY-NC-SA 4.0** 许可证。
63
+ - 允许个人和研究使用
64
+ - 允许修改和再分发(需注明来源)
65
+ - 不允许商业用途
66
+
67
+ ---
68
+
69
+ ## 日本語
70
+
71
+ ### 概要
72
+ [microsoft/Phi-3.5-mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct) をベースにファインチューニングしたローカル PC アシスタントモデルです。コンピュータハードウェア・ソフトウェアのトラブルシューティングや技術的な質問に特化しています。
73
+
74
+ **現バージョンは英語のみ対応しています。** 日本語・中国語対応は開発中です。
75
+
76
+ ### 原典とライセンス
77
+ | 項目 | 出典 | ライセンス |
78
+ |------|------|-----------|
79
+ | ベースモデル | [microsoft/Phi-3.5-mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct) | MIT License |
80
+ | 学習データセット | [kunishou/databricks-dolly-15k-ja](https://huggingface.co/datasets/kunishou/databricks-dolly-15k-ja)(原典:[databricks-dolly-15k](https://huggingface.co/datasets/databricks/databricks-dolly-15k)) | CC BY-SA 3.0 |
81
+
82
+ ### 本モデルのライセンス
83
+ 本ファインチューニングモデルは **CC BY-NC-SA 4.0** ライセンスのもとで公開しています。
84
+ - 個人・研究目的での使用可
85
+ - 改変・再配布可(出典明記が必要)
86
+ - 商用利用不可
87
+
88
+ ---
89
+
90
+ ## English
91
+
92
+ ### Overview
93
+ A local PC assistant model fine-tuned from [microsoft/Phi-3.5-mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct), specialized in computer hardware/software troubleshooting and technical Q&A.
94
+
95
+ **Current version supports English only.** Chinese and Japanese support is under development.
96
+
97
+ ### Model Details
98
+ | Item | Detail |
99
+ |------|--------|
100
+ | Base Model | microsoft/Phi-3.5-mini-instruct |
101
+ | Fine-tuning Method | QLoRA (4-bit NF4 + LoRA r=16) |
102
+ | Training Data | 15,015 instruction samples |
103
+ | Training Epochs | 3 |
104
+ | Final Loss | 2.43 |
105
+ | Hardware | NVIDIA RTX A5000 16GB |
106
+
107
+ ### Credits & Licenses
108
+ | Item | Source | License |
109
+ |------|--------|---------|
110
+ | Base Model | [microsoft/Phi-3.5-mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct) | MIT License |
111
+ | Training Dataset | [kunishou/databricks-dolly-15k-ja](https://huggingface.co/datasets/kunishou/databricks-dolly-15k-ja) (original: [databricks-dolly-15k](https://huggingface.co/datasets/databricks/databricks-dolly-15k)) | CC BY-SA 3.0 |
112
+
113
+ ### License
114
+ This fine-tuned model is released under **CC BY-NC-SA 4.0** (Attribution-NonCommercial-ShareAlike).
115
+ - Personal and research use permitted
116
+ - Modification and redistribution permitted (with attribution)
117
+ - Commercial use is NOT permitted
118
+
119
+ ---
120
+
121
+ *Fine-tuned by [hiko1999](https://huggingface.co/hiko1999)*
adapter_config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "/home/hiko1999/models/phi-3.5-mini",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 32,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "megatron_config": null,
23
+ "megatron_core": "megatron.core",
24
+ "modules_to_save": null,
25
+ "peft_type": "LORA",
26
+ "peft_version": "0.18.1",
27
+ "qalora_group_size": 16,
28
+ "r": 16,
29
+ "rank_pattern": {},
30
+ "revision": null,
31
+ "target_modules": [
32
+ "o_proj",
33
+ "down_proj",
34
+ "gate_up_proj",
35
+ "qkv_proj"
36
+ ],
37
+ "target_parameters": null,
38
+ "task_type": "CAUSAL_LM",
39
+ "trainable_token_indices": null,
40
+ "use_dora": false,
41
+ "use_qalora": false,
42
+ "use_rslora": false
43
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b63d7b8ab3d061849761a4a2577bf99b8322a58f4700a7f16770ab53b2576ec0
3
+ size 50366280
chat_template.jinja ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {% for message in messages %}{% if message['role'] == 'system' and message['content'] %}{{'<|system|>
2
+ ' + message['content'] + '<|end|>
3
+ '}}{% elif message['role'] == 'user' %}{{'<|user|>
4
+ ' + message['content'] + '<|end|>
5
+ '}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>
6
+ ' + message['content'] + '<|end|>
7
+ '}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>
8
+ ' }}{% else %}{{ eos_token }}{% endif %}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<s>",
4
+ "clean_up_tokenization_spaces": false,
5
+ "eos_token": "<|endoftext|>",
6
+ "is_local": true,
7
+ "legacy": false,
8
+ "model_max_length": 131072,
9
+ "pad_token": "<|endoftext|>",
10
+ "padding_side": "right",
11
+ "sp_model_kwargs": {},
12
+ "tokenizer_class": "TokenizersBackend",
13
+ "unk_token": "<unk>",
14
+ "use_default_system_prompt": false
15
+ }