BhumikaMak commited on
Commit
f4731f9
·
verified ·
1 Parent(s): edc8989

fix: netron embed

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -48,7 +48,7 @@ def process_image(sample_choice, uploaded_image, yolo_versions):
48
 
49
  def start_netron_backend(model_file):
50
  def serve_netron():
51
- netron.start(model_file) # Start Netron without the 'port' argument
52
 
53
  # Launch Netron in a separate thread
54
  threading.Thread(target=serve_netron, daemon=True).start()
@@ -63,6 +63,7 @@ def view_netron_model():
63
  start_netron_backend(preloaded_model_file)
64
  return '<iframe src="http://localhost:8080/" width="100%" height="600px"></iframe>'
65
 
 
66
  # Custom CSS for styling (optional)
67
  custom_css = """
68
  #run_button {
@@ -138,4 +139,4 @@ with gr.Blocks(css=custom_css) as interface:
138
 
139
  # Launch Gradio app
140
  if __name__ == "__main__":
141
- interface.launch(share=False) # Changed share=True to share=False as Hugging Face Spaces doesn't support it.
 
48
 
49
  def start_netron_backend(model_file):
50
  def serve_netron():
51
+ netron.start(model_file, port=8080) # Start Netron on port 8080
52
 
53
  # Launch Netron in a separate thread
54
  threading.Thread(target=serve_netron, daemon=True).start()
 
63
  start_netron_backend(preloaded_model_file)
64
  return '<iframe src="http://localhost:8080/" width="100%" height="600px"></iframe>'
65
 
66
+
67
  # Custom CSS for styling (optional)
68
  custom_css = """
69
  #run_button {
 
139
 
140
  # Launch Gradio app
141
  if __name__ == "__main__":
142
+ interface.launch(share=True)