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

Function textsynth_completion

test/general/lm_eval/models/textsynth.py:25–38  ·  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

23
24
25def textsynth_completion(**kwargs):
26 """Query TextSynth API for completion.
27 Retry with back-off until they respond.
28 """
29 backoff_time = 3
30 while True:
31 try:
32 return _requests.post(**kwargs)
33 except _requests.exceptions.RequestException:
34 import traceback
35
36 traceback.print_exc()
37 time.sleep(backoff_time)
38 backoff_time *= 1.5
39
40
41class TextSynthLM(BaseLM):

Callers 2

loglikelihoodMethod · 0.85
greedy_untilMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected