MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / fewshot_context

Method fewshot_context

test/general/lm_eval/base.py:791–811  ·  view source on GitHub ↗
(
        self, doc, num_fewshot, provide_description=None, rnd=None, description=None
    )

Source from the content-addressed store, hash-verified

789 return []
790
791 def fewshot_context(
792 self, doc, num_fewshot, provide_description=None, rnd=None, description=None
793 ):
794 assert (
795 num_fewshot == 0
796 ), "The number of fewshot examples must be 0 for perplexity tasks."
797 assert (
798 rnd is not None
799 ), "A `random.Random` generator argument must be provided to `rnd`."
800 assert not provide_description, (
801 "The `provide_description` arg will be removed in future versions. To prepend "
802 "a custom description to the context, supply the corresponding string via the "
803 "`description` arg."
804 )
805 if provide_description is not None:
806 # nudge people to not specify it at all
807 print(
808 "WARNING: provide_description is deprecated and will be removed in a future version in favor of description_dict"
809 )
810
811 return ""
812
813 def higher_is_better(self):
814 return {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected