24 lines
824 B
Python
24 lines
824 B
Python
#!/usr/bin/env python3
|
||
"""Добор mis1-b4 после 429 (rate limit Mistral): пауза + одиночный повтор с бэкоффом."""
|
||
import time
|
||
import consilium_probe as cp
|
||
|
||
|
||
def main():
|
||
roster = cp.build_roster()
|
||
batches = cp.batches_of(roster)
|
||
b = batches[4]
|
||
system, user = cp.render_terminologist("\n\n".join(cp.block_of(c) for c in b))
|
||
cl = cp.client_for("mistral-large-2512")
|
||
for attempt in range(4):
|
||
try:
|
||
time.sleep(20 * (attempt + 1))
|
||
cp.call(cl, "mistral-large-2512", system, user + cp.CONF_NUM, "mis1-b4", None, False)
|
||
return
|
||
except Exception as e: # noqa: BLE001
|
||
print(f"attempt {attempt}: {type(e).__name__}: {e}")
|
||
raise SystemExit("mis1-b4 не добран")
|
||
|
||
|
||
if __name__ == "__main__":
|
||
main()
|