mav23 commited on
Commit
680dce4
·
verified ·
1 Parent(s): c3e785f

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +64 -0
  3. seqgpt-560m.Q4_0.gguf +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ seqgpt-560m.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - zh
6
+ inference: false
7
+ ---
8
+ # SeqGPT-560M
9
+
10
+ <!-- Provide a quick summary of what the model is/does. -->
11
+
12
+ This is SeqGPT-560M weight, a compact model targeting open-domain Natural Language Understanding (NLU). We refer you to our github [repo](https://github.com/Alibaba-NLP/SeqGPT) for more details.
13
+
14
+
15
+ ## Model Details
16
+
17
+ ### Model Description
18
+
19
+ <!-- Provide a longer summary of what this model is. -->
20
+
21
+ The model is fine-tuned based on [BLOOMZ-560M](https://huggingface.co/bigscience/bloomz-560m).
22
+
23
+ ### Model Sources
24
+
25
+ <!-- Provide the basic links for the model. -->
26
+
27
+ - **Repository:** [SeqGPT](https://github.com/Alibaba-NLP/SeqGPT)
28
+ - **Paper:** [arxiv](https://arxiv.org/abs/2308.10529)
29
+ - **Demo:** [demo](https://www.modelscope.cn/studios/TTCoding/open_ner/summary)
30
+
31
+ ## Uses
32
+
33
+
34
+ ```py
35
+ import torch
36
+ from transformers import AutoTokenizer, AutoModelForCausalLM, AutoModel
37
+
38
+ model_name_or_path = 'DAMO-NLP/SeqGPT-560M'
39
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
40
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path)
41
+ tokenizer.padding_side = 'left'
42
+ tokenizer.truncation_side = 'left'
43
+
44
+ if torch.cuda.is_available():
45
+ model = model.half().cuda()
46
+ model.eval()
47
+ GEN_TOK = '[GEN]'
48
+
49
+ while True:
50
+ sent = input('输入/Input: ').strip()
51
+ task = input('分类/classify press 1, 抽取/extract press 2: ').strip()
52
+ labels = input('标签集/Label-Set (e.g, labelA,LabelB,LabelC): ').strip().replace(',', ',')
53
+ task = '分类' if task == '1' else '抽取'
54
+
55
+ # Changing the instruction can harm the performance
56
+ p = '输入: {}\n{}: {}\n输出: {}'.format(sent, task, labels, GEN_TOK)
57
+ input_ids = tokenizer(p, return_tensors="pt", padding=True, truncation=True, max_length=1024)
58
+ input_ids = input_ids.to(model.device)
59
+ outputs = model.generate(**input_ids, num_beams=4, do_sample=False, max_new_tokens=256)
60
+ input_ids = input_ids.get('input_ids', input_ids)
61
+ outputs = outputs[0][len(input_ids[0]):]
62
+ response = tokenizer.decode(outputs, skip_special_tokens=True)
63
+ print('BOT: ========== \n{}'.format(response))
64
+ ```
seqgpt-560m.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0fe148d38693f97e67670d497bf908b47ddcab8e89ee2800aa73866dd1b4ebfd
3
+ size 539031904