MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / FDATwice

Class FDATwice

lm-eval-harness/lm_eval/tasks/based_fda/task.py:108–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 )
107
108class FDATwice(FDA):
109
110 def doc_to_text(self, doc):
111 question = doc["key"]+":"
112 while(doc["text"].lower().endswith(question.lower())):
113 doc["text"] = doc["text"][:-len(question)]
114
115 upper_key = doc['key'][0].upper() + doc['key'][1:]
116 question = upper_key +":"
117 doc['text'] = doc['text'].strip("\n").strip(".")
118 out = doc["text"]
119 if not out.endswith("."): out += "."
120 intro_q = question.strip(":")
121 out = f"Information about {intro_q}. " + out + "\n" + out + " " + question
122 return out

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected