Ontocord.AI commited on
Commit
2c3d005
1 Parent(s): 80f6011

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +16 -13
README.md CHANGED
@@ -96,13 +96,15 @@ class GPTNeoXExpertsForCasualLM(GPTNeoXForCausalLM):
96
  #hack - let's assume a single expert per batch
97
  if not expert:
98
  label, score = self.predict_expert(text[0])
99
- if score > 0.8:
100
- if "PubMed" in label or "FreeLaw" in label or "ArXiv" in label or "Github" in label or "USPTO" in label:
101
  expert = label
102
- else:
103
  expert = "MergedChat"
 
 
104
  else:
105
- expert = "MergedChat"
106
  if expert != self.curr_expert:
107
  print ("Switching to expert", expert)
108
  self.curr_expert = expert
@@ -155,27 +157,28 @@ print (model.generate_with_expert("source code for sorting a list <bot>:", token
155
  print ('##')
156
  print (model.generate_with_expert("When was Abraham Lincoln born? <bot>:", tokenizer) [0])
157
  print ('##')
158
- print (model.generate_with_expert("Medical journal article about ovarian cancer <bot>:", tokenizer) [0])
159
  ```
160
 
161
  ## Produces this output:
162
 
163
  ```
164
- Warning : `load_model` does not return WordVectorModel or SupervisedModel any more, but a `FastText` object which is very similar.
165
- /root/.cache/huggingface/hub/models--Multi-Domain-Expert-Layers--MDEL-theblackcat-chat-5-experts/snapshots/a8a5b15d85eb0342825063fa1d7b83465f9eefa6/expert_classify.ftz
166
- Setting `pad_token_id` to `eos_token_id`:0 for open-end generation.
167
  ##
168
  Switching to expert Github
169
  Setting `pad_token_id` to `eos_token_id`:0 for open-end generation.
170
- source code for sorting a list : sort( sort( sorted( sorted( sorted( sorted( sorted( sorted( [ x, y * x - 1 + y / y ])) ) ) )) ) ). unique(). sort( key ='sorted' ). sort_key( sort_key = 0, reverse = True ) # [ 5.1.2, 5.1.3, 3, 2, 1] asd, 6, 7 # { 0.4 } asd # [ 5.2.7, 4.5.4, 6
 
171
  ##
172
- Switching to expert MergedChat
173
  Setting `pad_token_id` to `eos_token_id`:0 for open-end generation.
174
- When was Abraham Lincoln born? : This is an interesting topic to be asked about and I will try to give a bit of information, but it is very important that you should read the book by Robert O'Brien (1834-1858). [Abraham Lincoln and His Family](_URL_0_) which I highly recommend. This is a biography of a man who lived during the American civil war and had been a US President for 8 years in 1860. There are quite a lot of books available on Lincoln's life and his family. It would help me if you were more specific as I only knew him
 
 
175
  ##
176
  Switching to expert PubMed-Abstracts
177
- Medical journal article about ovarian cancer :
178
- "Cancer of the Ova" by Susan K. Hines, PhD - On April 10th, 2007, researchers from the National Cancer Institute discovered a mechanism called [Cullin Kin Reductions](_URL_0_) that can reduce and prevent this deadly disease in humans. This is called an "Cullin-R family". These proteins are involved in protein synthesis in the cell that is responsible for cellular maintenance and repair, and these two groups (Kin reduction and Mutagenesis) work on this process all the way to DNA replication during DNA synthesis. In a
 
179
  ```
180
 
181
  ### To recreate the expert, modify this script. We can also extend to do dynamic merging and/or experitment with different weights for different layers.
 
96
  #hack - let's assume a single expert per batch
97
  if not expert:
98
  label, score = self.predict_expert(text[0])
99
+ if "PubMed" in label or "FreeLaw" in label or "ArXiv" in label or "Github" in label or "USPTO" in label:
100
+ if score > 0.8:
101
  expert = label
102
+ elif score > 0.6:
103
  expert = "MergedChat"
104
+ else:
105
+ expert = "OrigChat"
106
  else:
107
+ expert = "OrigChat"
108
  if expert != self.curr_expert:
109
  print ("Switching to expert", expert)
110
  self.curr_expert = expert
 
157
  print ('##')
158
  print (model.generate_with_expert("When was Abraham Lincoln born? <bot>:", tokenizer) [0])
159
  print ('##')
160
+ print (model.generate_with_expert("Medical journal article about ovarian cancer <bot>:", tokenizer) [0])
161
  ```
162
 
163
  ## Produces this output:
164
 
165
  ```
 
 
 
166
  ##
167
  Switching to expert Github
168
  Setting `pad_token_id` to `eos_token_id`:0 for open-end generation.
169
+ source code for sorting a list : [sort_by(a) > sort_by(([1, 2])) > sort_by([])]
170
+ sort_by([sort_by([1, 2] + [10 < 5]), 1 - 10 < 5]) # Error: invalid input. [sort_by((1 - 4 - 6)) > sort_by((2 * 9))) > sort_by(-4 - (-6 - -7)) > sort_by(-8 - (-9 - -5)) > sort_by(-(-7 - (-8 - (9)))) > sort_by
171
  ##
172
+ Switching to expert OrigChat
173
  Setting `pad_token_id` to `eos_token_id`:0 for open-end generation.
174
+ When was Abraham Lincoln born? : I'm sorry. Lincoln's parents had died in a plane crash shortly after he was born, and so he spent most of his formative years being raised by his older brother, William Herndon (who also served as Lincoln's secretary during the Civil War).
175
+
176
+ Lincoln's family had been poor all their lives, and were very close to poverty when he was an infant. As a result, there are many stories about him that show how he struggled with hunger at a young age, which led him to want to be able to eat whatever was available. He often ate only enough to
177
  ##
178
  Switching to expert PubMed-Abstracts
179
+ Medical journal article about ovarian cancer : A retrospective study of a population-based cohort in Northern Ireland.
180
+
181
+ In the 1990s and early 2000, there was an increase in the number of new patients with non-ovarian malignancy seen at the National Hospital for Women's Services (Nish) Cancer Screening Service. It is likely that the increase came from a screening programme in the Northern Ireland Health and Care Plan, where people who are not in employment were offered cancer screening by a group of local health care practitioners or nurses. This approach would be appropriate outside the Northern Ireland Cancer Screening Programme and I suspect it was the practice
182
  ```
183
 
184
  ### To recreate the expert, modify this script. We can also extend to do dynamic merging and/or experitment with different weights for different layers.