Hi Mert, thanks for your efforts in torchview, which is very useful to visualize models.
Though it works in some models (e.g. âbert-base-uncasedâ as you mentioned), there is a problem for some other models like âgoogle/flan-t5-smallâ. Details can be found below
tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small")
model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small")
input_text = "translate English to German: How old are you?"
inputs = tokenizer(input_text, return_tensors="pt")
model_graph = draw_graph(model, input_data=inputs).visual_graph
# Line below triggers an error: "RuntimeError: Failed to run torchgraph"
model_graph.render(directory='/home/jeff/tmp/graphviz_output').replace('\\', '/')