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

Class PromptString

lm-eval-harness/lm_eval/prompts/__init__.py:110–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108
109
110class PromptString:
111 def __init__(self, prompt_string):
112 self.prompt_string = prompt_string
113
114 def apply(self, doc):
115 doc_to_text = self.prompt_string["doc_to_text"]
116 doc_to_target = self.prompt_string["doc_to_target"]
117
118 # TODO need a way to process doc_to_choice
119 if "doc_to_choice" in self.prompt_string:
120 raise Exception("Not yet implemented to accept doc_to_choice")
121
122 text_string = utils.apply_template(doc_to_text, doc)
123 target_string = utils.apply_template(doc_to_target, doc)
124
125 return [text_string, target_string]

Callers 1

get_promptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected