You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtxtfew_shot_examples= [
{"question": "What is?", "answer": "It is"},
{"question": "What is?", "answer": "It is"}
]
llm=txt.lm.Normal()
defrandom_prompt(prompt):
chosen=txt.random.choose(few_shot_examples)
forexinchosen:
prompt.newline(f"{ex.question}: {ex.answer}")
returnllm(prompt)
result=txt.lm.beam_search(random_prompt("Please answer the following question"))
result.eval()
# Somethingresult.eval()
# Something different since the few shot examples are drawn at random
We can use simulation-based inference to infer the best choice of few-shot examples for a given use-case.
This discussion was converted from issue #4 on March 25, 2023 12:26.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Builds on the specs defined in #8.
We can use simulation-based inference to infer the best choice of few-shot examples for a given use-case.
Beta Was this translation helpful? Give feedback.
All reactions