thundax commited on
Commit
49dc9c2
·
verified ·
1 Parent(s): 51e330a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +74 -62
README.md CHANGED
@@ -1,63 +1,75 @@
1
- # Qwen2.5-1.5B-Sign
2
-
3
- ## Introduction
4
-
5
- Qwen2.5-Sign is a text-to-chinese-sign model base on Qwen2.5
6
-
7
- ## Finetune Details
8
-
9
- - Finetune dataset: [alpaca-zh-text2sign](https://huggingface.co/datasets/thundax/alpaca-zh-text2sign)
10
- - Finetune parameter
11
-
12
- | Parameter | Value |
13
- |-----------------------------|--------|
14
- | learning_rate | 5e-05 |
15
- | train_batch_size | 4 |
16
- | eval_batch_size | 4 |
17
- | gradient_accumulation_steps | 8 |
18
- | total_train_batch_size | 32 |
19
- | lr_scheduler_type | cosine |
20
- | lr_scheduler_warmup_steps | 100 |
21
- | num_epochs | 4 |
22
-
23
- ## Quickstart
24
-
25
- ```python
26
- from transformers import AutoModelForCausalLM, AutoTokenizer
27
-
28
- device = "cuda" # the device to load the model onto
29
-
30
- model = AutoModelForCausalLM.from_pretrained(
31
- "thundax/Qwen2.5-1.5B-Sign",
32
- torch_dtype="auto",
33
- device_map="auto"
34
- )
35
- tokenizer = AutoTokenizer.from_pretrained("thundax/Qwen2.5-1.5B-Sign")
36
-
37
- text = "站一个制高点看上海,上海的弄堂是壮观的景象。它是这城市背景一样的东西。"
38
- input_text = f'Translate sentence into labels\n{text}\n'
39
- model_inputs = tokenizer([input_text], return_tensors="pt").to(device)
40
-
41
- generated_ids = model.generate(
42
- model_inputs.input_ids,
43
- max_new_tokens=512
44
- )
45
- generated_ids = [
46
- output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
47
- ]
48
-
49
- response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
50
- ```
51
-
52
- ## Citation
53
-
54
- If you find our work helpful, feel free to give us a cite.
55
-
56
- ```
57
- @software{qwen2-sign,
58
- author = {thundax},
59
- title = {qwen2-sign: A Tool for Text to Sign},
60
- year = {2025},
61
- url = {https://github.com/thundax-lyp},
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
63
  ```
 
1
+ ---
2
+ license: mit
3
+ datasets:
4
+ - thundax/alpaca-zh-text2sign
5
+ language:
6
+ - zh
7
+ metrics:
8
+ - accuracy
9
+ base_model:
10
+ - Qwen/Qwen2.5-1.5B
11
+ pipeline_tag: text-generation
12
+ ---
13
+ # Qwen2.5-1.5B-Sign
14
+
15
+ ## Introduction
16
+
17
+ Qwen2.5-Sign is a text-to-chinese-sign model base on Qwen2.5
18
+
19
+ ## Finetune Details
20
+
21
+ - Finetune dataset: [alpaca-zh-text2sign](https://huggingface.co/datasets/thundax/alpaca-zh-text2sign)
22
+ - Finetune parameter
23
+
24
+ | Parameter | Value |
25
+ |-----------------------------|--------|
26
+ | learning_rate | 5e-05 |
27
+ | train_batch_size | 4 |
28
+ | eval_batch_size | 4 |
29
+ | gradient_accumulation_steps | 8 |
30
+ | total_train_batch_size | 32 |
31
+ | lr_scheduler_type | cosine |
32
+ | lr_scheduler_warmup_steps | 100 |
33
+ | num_epochs | 4 |
34
+
35
+ ## Quickstart
36
+
37
+ ```python
38
+ from transformers import AutoModelForCausalLM, AutoTokenizer
39
+
40
+ device = "cuda" # the device to load the model onto
41
+
42
+ model = AutoModelForCausalLM.from_pretrained(
43
+ "thundax/Qwen2.5-1.5B-Sign",
44
+ torch_dtype="auto",
45
+ device_map="auto"
46
+ )
47
+ tokenizer = AutoTokenizer.from_pretrained("thundax/Qwen2.5-1.5B-Sign")
48
+
49
+ text = "站一个制高点看上海,上海的弄堂是壮观的景象。它是这城市背景一样的东西。"
50
+ input_text = f'Translate sentence into labels\n{text}\n'
51
+ model_inputs = tokenizer([input_text], return_tensors="pt").to(device)
52
+
53
+ generated_ids = model.generate(
54
+ model_inputs.input_ids,
55
+ max_new_tokens=512
56
+ )
57
+ generated_ids = [
58
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
59
+ ]
60
+
61
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
62
+ ```
63
+
64
+ ## Citation
65
+
66
+ If you find our work helpful, feel free to give us a cite.
67
+
68
+ ```
69
+ @software{qwen2-sign,
70
+ author = {thundax},
71
+ title = {qwen2-sign: A Tool for Text to Sign},
72
+ year = {2025},
73
+ url = {https://github.com/thundax-lyp},
74
+ }
75
  ```