ait-hf commited on
Commit
1cad9a3
·
verified ·
1 Parent(s): 188a7e6

publish family

Browse files
family_v0007/heads/index.json CHANGED
@@ -23,6 +23,36 @@
23
  "file": "language.npz",
24
  "n_pos": 1500
25
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  "support": {
27
  "version": "v0007-support",
28
  "description": "customer-support and product requests: intents, what the customer wants, which team or category handles it",
 
23
  "file": "language.npz",
24
  "n_pos": 1500
25
  },
26
+ "multilingual": {
27
+ "version": "v0007-multilingual",
28
+ "description": "requests in languages other than English: intents, entailment, tickets in German, French, Spanish, Italian, Portuguese, Dutch, Polish, Romanian, Turkish, Russian, Japanese, Chinese, Arabic, Hindi",
29
+ "file": "multilingual.npz",
30
+ "n_pos": 1500
31
+ },
32
+ "rag": {
33
+ "version": "v0007-rag",
34
+ "description": "retrieval and grounding: does a passage answer or support a query, is a claim supported by the evidence, is an answer grounded in the source",
35
+ "file": "rag.npz",
36
+ "n_pos": 1500
37
+ },
38
+ "legal": {
39
+ "version": "v0007-legal",
40
+ "description": "contracts, terms of service, court holdings: clause types, unfair terms, legal reasoning",
41
+ "file": "legal.npz",
42
+ "n_pos": 1500
43
+ },
44
+ "medical": {
45
+ "version": "v0007-medical",
46
+ "description": "medical and biomedical questions: abstracts, clinical multiple choice, health claims",
47
+ "file": "medical.npz",
48
+ "n_pos": 1500
49
+ },
50
+ "finance": {
51
+ "version": "v0007-finance",
52
+ "description": "financial news and markets: sentiment for a stock, event type, central-bank stance, price direction",
53
+ "file": "finance.npz",
54
+ "n_pos": 1500
55
+ },
56
  "support": {
57
  "version": "v0007-support",
58
  "description": "customer-support and product requests: intents, what the customer wants, which team or category handles it",
serve/s1/family.py CHANGED
@@ -219,8 +219,10 @@ class RouterHeads:
219
  self.mu, self.sd = nrm["mu"], nrm["sd"]
220
  self.heads = {}
221
  for d, meta in self.index.items():
222
- f = np.load(self.path / meta["file"])
223
- self.heads[d] = (f["w"], float(f["b"]))
 
 
224
  self.domains = [(d, meta.get("description", d)) for d, meta in self.index.items()]
225
 
226
  def scores(self, h: np.ndarray) -> dict[str, float]:
@@ -262,8 +264,8 @@ class FamilyEngine:
262
  self.heads: RouterHeads | None = None
263
  if (self.dir / "heads" / "index.json").exists(): # per-adapter heads take precedence over the softmax head
264
  self.heads = RouterHeads(self.dir / "heads")
265
- for d, meta in self.heads.index.items():
266
- self.domains.setdefault(d, meta["version"])
267
  print(f"[family] router: {len(self.heads.heads)} per-adapter heads")
268
  elif (self.dir / "router_head.pt").exists():
269
  self.router = RouterHead(self.dir / "router_head.pt")
 
219
  self.mu, self.sd = nrm["mu"], nrm["sd"]
220
  self.heads = {}
221
  for d, meta in self.index.items():
222
+ if (self.path / meta["file"]).exists(): # a published family ships only its adapters' heads
223
+ f = np.load(self.path / meta["file"])
224
+ self.heads[d] = (f["w"], float(f["b"]))
225
+ # the router prompt lists every indexed domain, with or without a head: the heads were fit on that exact prompt
226
  self.domains = [(d, meta.get("description", d)) for d, meta in self.index.items()]
227
 
228
  def scores(self, h: np.ndarray) -> dict[str, float]:
 
264
  self.heads: RouterHeads | None = None
265
  if (self.dir / "heads" / "index.json").exists(): # per-adapter heads take precedence over the softmax head
266
  self.heads = RouterHeads(self.dir / "heads")
267
+ for d in self.heads.heads:
268
+ self.domains.setdefault(d, self.heads.index[d]["version"])
269
  print(f"[family] router: {len(self.heads.heads)} per-adapter heads")
270
  elif (self.dir / "router_head.pt").exists():
271
  self.router = RouterHead(self.dir / "router_head.pt")