| 168 | sampling_params = SamplingParams(temperature=temperature, max_tokens=128000, stop_token_ids=[tokenizer.eos_token_id]) |
| 169 | |
| 170 | def run_llm(msg): |
| 171 | # vllm |
| 172 | prompt_token_ids = [tokenizer.apply_chat_template(messages, add_generation_prompt=True) for messages in [msg]] |
| 173 | |
| 174 | outputs = llm.generate(prompt_token_ids=prompt_token_ids, sampling_params=sampling_params) |
| 175 | |
| 176 | completion = [output.outputs[0].text for output in outputs] |
| 177 | |
| 178 | return completion[0] |
| 179 | |
| 180 | artifact_output_dir=f'{output_dir}/analyzing_artifacts' |
| 181 | os.makedirs(artifact_output_dir, exist_ok=True) |