军舰
commited on
Commit
•
aa9de2b
1
Parent(s):
e3678d1
Update upload model to huggingface hub.
Browse files
README.md
CHANGED
@@ -4,15 +4,15 @@ license: mit
|
|
4 |
|
5 |
## [mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL](https://huggingface.co/mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL)
|
6 |
|
7 |
-
本次微调的模型我已经上传到了 HuggingFace Hub
|
8 |
|
9 |
-
### 安装
|
10 |
|
11 |
```bash
|
12 |
pip install mlx-lm
|
13 |
```
|
14 |
|
15 |
-
### 生成
|
16 |
```
|
17 |
python -m mlx_lm.generate --model mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL \
|
18 |
--max-tokens 50 \
|
@@ -61,7 +61,7 @@ if __name__ == "__main__":
|
|
61 |
|
62 |
### 样本示例
|
63 |
|
64 |
-
```
|
65 |
table: 1-10753917-1
|
66 |
columns: Season, Driver, Team, Engine, Poles, Wins, Podiums, Points, Margin of defeat
|
67 |
Q: Which podiums did the alfa romeo team have?
|
@@ -129,7 +129,7 @@ python fuse.py --model mistralai/Mistral-7B-v0.1 \
|
|
129 |
```
|
130 |
|
131 |
|
132 |
-
## 生成
|
133 |
|
134 |
### 王军建的姓名是什么?
|
135 |
|
@@ -244,13 +244,69 @@ SELECT COUNT Name FROM students WHERE Grade = 9
|
|
244 |
|
245 |
附加的提示信息可以轻松添加,不用太在意放置的位置。
|
246 |
|
247 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
|
249 |
```bash
|
250 |
-
|
251 |
-
|
252 |
-
--quantize \
|
253 |
-
--upload-repo mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL
|
254 |
```
|
255 |
|
256 |
|
|
|
4 |
|
5 |
## [mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL](https://huggingface.co/mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL)
|
6 |
|
7 |
+
本次微调的模型我已经上传到了 HuggingFace Hub 上,大家可以进行尝试。
|
8 |
|
9 |
+
### 安装 mlx-lm
|
10 |
|
11 |
```bash
|
12 |
pip install mlx-lm
|
13 |
```
|
14 |
|
15 |
+
### 生成 SQL
|
16 |
```
|
17 |
python -m mlx_lm.generate --model mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL \
|
18 |
--max-tokens 50 \
|
|
|
61 |
|
62 |
### 样本示例
|
63 |
|
64 |
+
```
|
65 |
table: 1-10753917-1
|
66 |
columns: Season, Driver, Team, Engine, Poles, Wins, Podiums, Points, Margin of defeat
|
67 |
Q: Which podiums did the alfa romeo team have?
|
|
|
129 |
```
|
130 |
|
131 |
|
132 |
+
## 生成 SQL
|
133 |
|
134 |
### 王军建的姓名是什么?
|
135 |
|
|
|
244 |
|
245 |
附加的提示信息可以轻松添加,不用太在意放置的位置。
|
246 |
|
247 |
+
|
248 |
+
## 上传模型到 HuggingFace Hub
|
249 |
+
|
250 |
+
1. 加入 [MLX Community](https://huggingface.co/mlx-community) 组织
|
251 |
+
|
252 |
+
2. 在 MLX Community 组织中创建一个新的模型 [mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL](https://huggingface.co/mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL)
|
253 |
+
|
254 |
+
3. 克隆仓库 [mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL](https://huggingface.co/mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL)
|
255 |
+
|
256 |
+
```bash
|
257 |
+
git clone https://huggingface.co/mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL
|
258 |
+
```
|
259 |
+
|
260 |
+
4. 将生成的模型文件(`lora_fused_model` 目录下的所有文件)复制到仓库目录下
|
261 |
+
|
262 |
+
5. 上传模型到 HuggingFace Hub
|
263 |
+
|
264 |
+
```bash
|
265 |
+
git add .
|
266 |
+
git commit -m "Fine tuning Text2SQL based on Mistral-7B using LoRA on MLX"
|
267 |
+
git push
|
268 |
+
```
|
269 |
+
|
270 |
+
### git push 错误
|
271 |
+
|
272 |
+
1. 不能 push
|
273 |
+
|
274 |
+
错误信息:
|
275 |
+
|
276 |
+
```
|
277 |
+
Uploading LFS objects: 0% (0/2), 0 B | 0 B/s, done.
|
278 |
+
batch response: Authorization error.
|
279 |
+
error: failed to push some refs to 'https://huggingface.co/mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL'
|
280 |
+
```
|
281 |
+
|
282 |
+
解决方法:
|
283 |
+
|
284 |
+
```bash
|
285 |
+
vim .git/config
|
286 |
+
```
|
287 |
+
```conf
|
288 |
+
[remote "origin"]
|
289 |
+
url = https://wangjunjian:write_token@huggingface.co/mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL
|
290 |
+
fetch = +refs/heads/*:refs/remotes/origin/*
|
291 |
+
```
|
292 |
+
|
293 |
+
2. 不能上传大于 5GB 的文件
|
294 |
+
|
295 |
+
错误信息:
|
296 |
+
|
297 |
+
```
|
298 |
+
warning: current Git remote contains credentials
|
299 |
+
batch response:
|
300 |
+
You need to configure your repository to enable upload of files > 5GB.
|
301 |
+
Run "huggingface-cli lfs-enable-largefiles ./path/to/your/repo" and try again.
|
302 |
+
```
|
303 |
+
|
304 |
+
|
305 |
+
解决方法:
|
306 |
|
307 |
```bash
|
308 |
+
huggingface-cli longin
|
309 |
+
huggingface-cli lfs-enable-largefiles /Users/junjian/HuggingFace/mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL
|
|
|
|
|
310 |
```
|
311 |
|
312 |
|