Monor commited on
Commit
896dec2
1 Parent(s): e223a12

Upload Qwen2ForCausalLM

Browse files
Files changed (4) hide show
  1. README.md +4 -19
  2. config.json +29 -0
  3. generation_config.json +6 -0
  4. model.safetensors +3 -0
README.md CHANGED
@@ -1,28 +1,13 @@
1
  ---
2
- license: apache-2.0
3
  language:
4
  - zh
5
- pipeline_tag: text-generation
6
  tags:
7
  - not-for-all-audiences
 
8
  ---
9
 
10
- 数据来源自[h-corpus-2023](https://huggingface.co/datasets/a686d380/h-corpus-2023)
11
  模型来源自[Qwen1.5-0.5B](https://huggingface.co/Qwen/Qwen1.5-0.5B)
12
 
13
- 本模型仅用于学术研究或个人学习,严禁商用。
14
-
15
- ```
16
- from transformers import AutoModelForCausalLM, AutoTokenizer
17
-
18
- repo_id = 'Monor/Qwen1.5-0.5B-h-world'
19
- tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
20
- model = AutoModelForCausalLM.from_pretrained(repo_id, device_map="auto", trust_remote_code=True).eval()
21
-
22
- inputs = tokenizer('小青突然来到了我的房间', return_tensors='pt')
23
- inputs = inputs.to(model.device)
24
- pred = model.generate(**inputs, max_new_tokens=32, num_beams=4, do_sample=True)
25
- print(tokenizer.decode(pred.cpu()[0], skip_special_tokens=True))
26
-
27
- 输出:小青突然来到了我的房间,吓了我一跳。她见我睡着了,就脱了衣服钻进了被窝里,然后搂着我睡着了。
28
- ```
 
1
  ---
 
2
  language:
3
  - zh
4
+ license: apache-2.0
5
  tags:
6
  - not-for-all-audiences
7
+ pipeline_tag: text-generation
8
  ---
9
 
10
+ 数据来源自[h-corpus-2023](https://huggingface.co/a686d380/h-corpus-2023)
11
  模型来源自[Qwen1.5-0.5B](https://huggingface.co/Qwen/Qwen1.5-0.5B)
12
 
13
+ 训练中(30%)...请等待更新
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "checkpoints",
3
+ "architectures": [
4
+ "Qwen2ForCausalLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 151643,
8
+ "eos_token_id": 151643,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 1024,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 2816,
13
+ "max_position_embeddings": 32768,
14
+ "max_window_layers": 21,
15
+ "model_type": "qwen2",
16
+ "num_attention_heads": 16,
17
+ "num_hidden_layers": 24,
18
+ "num_key_value_heads": 16,
19
+ "rms_norm_eps": 1e-06,
20
+ "rope_theta": 1000000.0,
21
+ "sliding_window": 32768,
22
+ "tie_word_embeddings": true,
23
+ "torch_dtype": "float32",
24
+ "transformers_version": "4.38.2",
25
+ "use_cache": false,
26
+ "use_dynamic_ntk": true,
27
+ "use_sliding_window": false,
28
+ "vocab_size": 151936
29
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "eos_token_id": 151643,
4
+ "max_new_tokens": 2048,
5
+ "transformers_version": "4.38.2"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31d2d20652659003f74189e4b88727843129966783c090008b543aa4e1e756fc
3
+ size 1855983640