You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently to run requests to a model hosted on slurm, we need to do something like this
from nemo_skills.inference.server.code_execution_model import get_code_execution_model
from nemo_skills.code_execution.sandbox import get_sandbox
from nemo_skills.prompt.utils import Prompt, get_prompt
import os
os.environ['NEMO_SKILLS_SSH_KEY_PATH'] = '<path to key>'
os.environ['NEMO_SKILLS_SSH_SERVER'] = '<cluster hostname>'
sandbox = get_sandbox(
sandbox_type="local",
host='<cluster host>',
)
llm = get_code_execution_model(
server_type='trtllm',
host='<cluster host>',
sandbox=sandbox,
)
prompt = get_prompt('generic/default', 'llama3-instruct')
prompt.config.system = "Environment: ipython\n\nUse Python to solve user's request."
prompts = [prompt.fill({
'question': "Calculate how many 'r' are in strawberry.",
})]
extra_generate_params = {
"code_begin": prompt.config.template.code_begin,
"code_end": prompt.config.template.code_end,
"code_output_begin": prompt.config.template.code_output_begin,
"code_output_end": prompt.config.template.code_output_end,
}
print(prompts[0])
outputs = llm.generate(
prompts=prompts,
stop_phrases=prompt.stop_phrases,
tokens_to_generate=128,
temperature=0.0,
random_seed=0,
**extra_generate_params,
)
print(outputs[0]["generation"])
We should add some function that will set up that SSH connection through the nemo-run tunnel. Ideally also avoid using sshtunnel_requests since vllm server doesn't support that
The text was updated successfully, but these errors were encountered:
Currently to run requests to a model hosted on slurm, we need to do something like this
We should add some function that will set up that SSH connection through the nemo-run tunnel. Ideally also avoid using sshtunnel_requests since vllm server doesn't support that
The text was updated successfully, but these errors were encountered: