mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-24 17:04:55 +00:00
update: sandbox
This commit is contained in:
parent
f70103c781
commit
48941b455c
2 changed files with 16 additions and 0 deletions
|
|
@ -50,6 +50,8 @@ def _write_optimizer_code_to_volume(code: str, volume: Volume) -> str:
|
|||
# --- Modal Function ---
|
||||
@app.function(
|
||||
image=base_image,
|
||||
scaledown_window=60 * 5,
|
||||
min_containers=2,
|
||||
timeout=60 * 30,
|
||||
volumes={"/optimizers": optimizers_volume, "/sysPrompt": sys_prompt_volume},
|
||||
secrets=[Secret.from_name("optimizerSecret")],
|
||||
|
|
|
|||
14
environments/optimizer/test.py
Normal file
14
environments/optimizer/test.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from modal.functions import Function
|
||||
|
||||
send_code = Function.from_name("optimizer-test", "send_code")
|
||||
|
||||
res = send_code.remote("""
|
||||
import torch
|
||||
import math
|
||||
|
||||
class CustomOptimizer(torch.optim.Optimizer):
|
||||
def __init__(self, params, lr=0.01, beta1=0.9, beta2=0.999, eps=1e-8):
|
||||
defaults = dict(lr=lr, beta1=beta1, beta2=beta2, eps=eps)
|
||||
""")
|
||||
|
||||
print(res)
|
||||
Loading…
Add table
Add a link
Reference in a new issue