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

Function textsynth_completion

lm-eval-harness/lm_eval/models/textsynth.py:28–46  ·  view source on GitHub ↗

Query TextSynth API for completion. Retry with back-off until they respond.

(**kwargs)

Source from the content-addressed store, hash-verified

26
27
28def textsynth_completion(**kwargs):
29 """Query TextSynth API for completion.
30 Retry with back-off until they respond.
31 """
32
33 def _exception_callback(e: Exception, sleep_time: float) -> None:
34 import traceback
35
36 traceback.print_exc()
37
38 @retry_on_specific_exceptions(
39 on_exceptions=[_requests.exceptions.RequestException],
40 max_retries=None, # retry forever, consider changing
41 on_exception_callback=_exception_callback,
42 )
43 def completion():
44 return _requests.post(**kwargs)
45
46 return completion()
47
48
49@register_model("textsynth")

Callers 2

loglikelihoodMethod · 0.85
generate_untilMethod · 0.85

Calls 1

completionFunction · 0.70

Tested by

no test coverage detected