Skip to content

Commit 65556cc

Browse files
Peter JohnsonPeter Johnson
authored andcommitted
Get response from params while Shimmy is in progress
1 parent 0c9505c commit 65556cc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

evaluation_function/models/shannon_letters_ngram.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ def run(response, answer, params:Params) -> Result:
111111

112112
# === SINGLE MODE ===
113113
if mode == "single":
114-
prefix = params.get("response", "he").upper()
114+
if isinstance(response, str):
115+
prefix = response.upper()
116+
elif isinstance(params.get("response"), str):
117+
prefix = params["response"].upper() #<- hack for Shimmy
118+
else:
119+
prefix = "ELUCIDATE"
115120
top5 = generate_single_letter(lookups, context_window, prefix)
116121
if not top5:
117122
feedback = f"No data found for prefix '{prefix}' and n={context_window}."

0 commit comments

Comments
 (0)