Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
|
@@ -977,8 +977,9 @@ def create_interface():
|
|
| 977 |
def show_tree(html_file):
|
| 978 |
if html_file and os.path.exists(html_file):
|
| 979 |
try:
|
| 980 |
-
#
|
| 981 |
-
|
|
|
|
| 982 |
link_html = f'<a href="{file_url}" target="_blank">View ML Simplified Tree</a>'
|
| 983 |
return gr.update(value=link_html)
|
| 984 |
except Exception as e:
|
|
|
|
| 977 |
def show_tree(html_file):
|
| 978 |
if html_file and os.path.exists(html_file):
|
| 979 |
try:
|
| 980 |
+
# Convert to relative path for Gradio file serving
|
| 981 |
+
relative_path = os.path.relpath(html_file, os.getcwd())
|
| 982 |
+
file_url = f"/file={relative_path}"
|
| 983 |
link_html = f'<a href="{file_url}" target="_blank">View ML Simplified Tree</a>'
|
| 984 |
return gr.update(value=link_html)
|
| 985 |
except Exception as e:
|