doberst113080 commited on
Commit
bb7ca2c
·
1 Parent(s): cb395c4

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +114 -0
README.md ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_link: https://huggingface.co/01-ai/Yi-6B/blob/main/LICENSE
4
+ license_name: yi-license
5
+ model_creator: 01-ai
6
+ model_name: Yi 6B
7
+ model_type: yi
8
+ ---
9
+
10
+ # Model Card for Model ID
11
+
12
+ <!-- Provide a quick summary of what the model is/does. -->
13
+
14
+ dragon-yi-6b-v0 part of the dRAGon ("Delivering RAG On ...") model series, RAG-instruct trained on top of a Yi-6B base model.
15
+
16
+ DRAGON models have been fine-tuned with the specific objective of fact-based question-answering over complex business and legal documents with an emphasis on reducing hallucinations and providing short, clear answers for workflow automation.
17
+
18
+
19
+ ### Benchmark Tests
20
+
21
+ Evaluated against the benchmark test: [RAG-Instruct-Benchmark-Tester](https://www.huggingface.co/datasets/llmware/rag_instruct_benchmark_tester)
22
+ Average of 2 Test Runs with 1 point for correct answer, 0.5 point for partial correct or blank / NF, 0.0 points for incorrect, and -1 points for hallucinations.
23
+
24
+ --**Accuracy Score**: **99.5** correct out of 100
25
+ --Not Found Classification: 90.0%
26
+ --Boolean: 87.5%
27
+ --Math/Logic: 77.5%
28
+ --Complex Questions (1-5): 4 (Above Average)
29
+ --Summarization Quality (1-5): 4 (Above Average)
30
+ --Hallucinations: No hallucinations observed in test runs.
31
+
32
+ For test run results (and good indicator of target use cases), please see the files ("core_rag_test" and "answer_sheet" in this repo).
33
+
34
+ ### Model Description
35
+
36
+ <!-- Provide a longer summary of what this model is. -->
37
+
38
+ - **Developed by:** llmware
39
+ - **Model type:** Yi
40
+ - **Language(s) (NLP):** English
41
+ - **License:** Yi License [Link](https://huggingface.co/01-ai/Yi-6B/blob/main/LICENSE)
42
+ - **Finetuned from model:** Yi-6B
43
+
44
+
45
+ ### Direct Use
46
+
47
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
48
+
49
+ DRAGON is designed for enterprise automation use cases, especially in knowledge-intensive industries, such as financial services,
50
+ legal and regulatory industries with complex information sources.
51
+
52
+ DRAGON models have been trained for common RAG scenarios, specifically: question-answering, key-value extraction, and basic summarization as the core instruction types
53
+ without the need for a lot of complex instruction verbiage - provide a text passage context, ask questions, and get clear fact-based responses.
54
+
55
+ This model is licensed according to the terms of the license of the base model, Yi-6B, at this [link](https://huggingface.co/01-ai/Yi-6B/blob/main/LICENSE).
56
+
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ Any model can provide inaccurate or incomplete information, and should be used in conjunction with appropriate safeguards and fact-checking mechanisms.
63
+
64
+
65
+ ## How to Get Started with the Model
66
+
67
+ The fastest way to get started with BLING is through direct import in transformers:
68
+
69
+ from transformers import AutoTokenizer, AutoModelForCausalLM
70
+ tokenizer = AutoTokenizer.from_pretrained("dragon-yi-6b-v0")
71
+ model = AutoModelForCausalLM.from_pretrained("dragon-yi-6b-v0")
72
+
73
+ Please refer to the generation_test .py files in the Files repository, which includes 200 samples and script to test the model. The **generation_test_llmware_script.py** includes built-in llmware capabilities for fact-checking, as well as easy integration with document parsing and actual retrieval to swap out the test set for RAG workflow consisting of business documents.
74
+
75
+ The DRAGON model was fine-tuned with a simple "\<human> and \<bot> wrapper", so to get the best results, wrap inference entries as:
76
+
77
+ full_prompt = "<human>: " + my_prompt + "\n" + "<bot>:"
78
+
79
+ The BLING model was fine-tuned with closed-context samples, which assume generally that the prompt consists of two sub-parts:
80
+
81
+ 1. Text Passage Context, and
82
+ 2. Specific question or instruction based on the text passage
83
+
84
+ To get the best results, package "my_prompt" as follows:
85
+
86
+ my_prompt = {{text_passage}} + "\n" + {{question/instruction}}
87
+
88
+
89
+ If you are using a HuggingFace generation script:
90
+
91
+ # prepare prompt packaging used in fine-tuning process
92
+ new_prompt = "<human>: " + entries["context"] + "\n" + entries["query"] + "\n" + "<bot>:"
93
+
94
+ inputs = tokenizer(new_prompt, return_tensors="pt")
95
+ start_of_output = len(inputs.input_ids[0])
96
+
97
+ # temperature: set at 0.3 for consistency of output
98
+ # max_new_tokens: set at 100 - may prematurely stop a few of the summaries
99
+
100
+ outputs = model.generate(
101
+ inputs.input_ids.to(device),
102
+ eos_token_id=tokenizer.eos_token_id,
103
+ pad_token_id=tokenizer.eos_token_id,
104
+ do_sample=True,
105
+ temperature=0.3,
106
+ max_new_tokens=100,
107
+ )
108
+
109
+ output_only = tokenizer.decode(outputs[0][start_of_output:],skip_special_tokens=True)
110
+
111
+
112
+ ## Model Card Contact
113
+
114
+ Darren Oberst & llmware team