MCPcopy Create free account
hub / github.com/VITA-Group/WeLore / format_example

Function format_example

utils.py:42–50  ·  view source on GitHub ↗
(df, idx, include_answer=True)

Source from the content-addressed store, hash-verified

40
41
42def format_example(df, idx, include_answer=True):
43 prompt = df.iloc[idx, 0]
44 k = df.shape[1] - 2
45 for j in range(k):
46 prompt += "\n{}. {}".format(choices[j], df.iloc[idx, j + 1])
47 prompt += "\nAnswer:"
48 if include_answer:
49 prompt += " {}\n\n".format(df.iloc[idx, k + 1])
50 return prompt
51
52
53def gen_prompt(train_df, subject, k=-1):

Callers 2

gen_promptFunction · 0.85
evalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected