preface that I'm not exactly in love with the solution below. does this work?

graph = pm.model_to_graphviz(model=hierarchical)
displayHTML(graph.pipe(format="svg").decode("utf-8"))

also the reason it gives you that .pdf type thing is because by default it renders it to a pdf, and you set the filename using the filename parameter. you can do different formats (pdf,png,svg,...)