re-type commited on
Commit
284bd4d
·
verified ·
1 Parent(s): 927f45c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- # Use the same file-serving URL as the download link
981
- file_url = f"/file={html_file}"
 
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: