Closed gabrie closed 2 weeks ago
Tell it specifically in the prompt on it's own line remember to import torch
... sometimes smaller LLMs don't really follow the initial instruction or understand what to do with that error, so you can try to reinforce it.
Keep getting this, no matter which model to use in Ollama
Write the Code
LLM COMMENTS:
Imports in code: ['import torchvision.transforms as transforms'] Stored script: def generated_function(input_data_1=None, input_data_2=None): def apply_transforms(image):
Apply all three tweaks to image
Error calling the generated function: name 'torch' is not defined Traceback (most recent call last): File "D:\ComfyUI\custom_nodes\anynode\nodes\any.py", line 391, in go result = locals_dict[function_name](any, input_data_2=any2) File "", line 19, in generated_function_21900ac62c88401fa67acabf7dee08c6
File "", line 4, in apply_transforms
NameError: name 'torch' is not defined
!!! Exception during processing!!! name 'torch' is not defined
Traceback (most recent call last):
File "D:\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\ComfyUI\custom_nodes\anynode\nodes\any.py", line 398, in go
raise e
File "D:\ComfyUI\custom_nodes\anynode\nodes\any.py", line 391, in go
result = locals_dict[function_name](any, input_data_2=any2)
File "", line 19, in generated_function_21900ac62c88401fa67acabf7dee08c6
File "", line 4, in apply_transforms
NameError: name 'torch' is not defined
Prompt executed in 15.60 seconds