BhumikaMak commited on
Commit
5bc30f0
·
verified ·
1 Parent(s): e24db03

return object data

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -166,9 +166,9 @@ from pathlib import Path
166
  # Function to visualize the model
167
  def visualize_model(model_file):
168
  # Save the uploaded file
169
- file_path = os.path.join(os.getcwd(), "weight_files/yolov5.onnx")
170
  with open(file_path, "wb") as f:
171
- f.write(model_file.read())
172
 
173
  # Start Netron server to serve the file
174
  port = 8081
@@ -195,5 +195,5 @@ demo = gr.Interface(
195
  description="Upload a model file to visualize its architecture using Netron.",
196
  )
197
 
198
- # Launch the app
199
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
166
  # Function to visualize the model
167
  def visualize_model(model_file):
168
  # Save the uploaded file
169
+ file_path = f"./models/{model_file.name}"
170
  with open(file_path, "wb") as f:
171
+ f.write(model_file.data) # FIXED: Use 'data' instead of 'read()'
172
 
173
  # Start Netron server to serve the file
174
  port = 8081
 
195
  description="Upload a model file to visualize its architecture using Netron.",
196
  )
197
 
198
+ # Launch the app with public link support
199
+ demo.launch(server_name="0.0.0.0", server_port=7860, share=True)