Spaces:
Runtime error
Runtime error
mrfakename
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -118,7 +118,7 @@ def calculate_width_at_depth(G, root):
|
|
118 |
return depth_count
|
119 |
|
120 |
|
121 |
-
def create_family_tree(start_model
|
122 |
genealogy = defaultdict(list)
|
123 |
get_model_names(start_model, genealogy) # Assuming this populates the genealogy
|
124 |
|
@@ -126,14 +126,8 @@ def create_family_tree(start_model, progress=gr.Progress()):
|
|
126 |
G = nx.DiGraph()
|
127 |
|
128 |
# Add nodes and edges to the graph
|
129 |
-
progress.total = len(genealogy.items())
|
130 |
-
items_done = 0
|
131 |
for parent, children in genealogy.items():
|
132 |
for child in children:
|
133 |
-
items_done += 1
|
134 |
-
if items_done >= len(genealogy.items()):
|
135 |
-
progress.progress += 1
|
136 |
-
progress.total = items_done
|
137 |
G.add_edge(parent, child)
|
138 |
|
139 |
# Get max depth
|
|
|
118 |
return depth_count
|
119 |
|
120 |
|
121 |
+
def create_family_tree(start_model):
|
122 |
genealogy = defaultdict(list)
|
123 |
get_model_names(start_model, genealogy) # Assuming this populates the genealogy
|
124 |
|
|
|
126 |
G = nx.DiGraph()
|
127 |
|
128 |
# Add nodes and edges to the graph
|
|
|
|
|
129 |
for parent, children in genealogy.items():
|
130 |
for child in children:
|
|
|
|
|
|
|
|
|
131 |
G.add_edge(parent, child)
|
132 |
|
133 |
# Get max depth
|