Spaces:
Paused
Paused
Commit
·
6d5ce82
1
Parent(s):
a007d51
Fixing the formatting
Browse files
proxy.py
CHANGED
|
@@ -44,13 +44,16 @@ from huggingface_hub import hf_hub_url
|
|
| 44 |
def chooser():
|
| 45 |
file_url = hf_hub_url(request.args.get("repo_id"), request.args.get("filename"))
|
| 46 |
|
|
|
|
|
|
|
|
|
|
| 47 |
return """
|
| 48 |
<html>
|
| 49 |
<head>
|
| 50 |
<title>Netron</title>
|
| 51 |
</head>
|
| 52 |
<body style="padding: 0; margin: 0; display: flex; flex-direction: row; align-items: center;">
|
| 53 |
-
<iframe id="netron" src="/netron?url={file_url}" style="width: 100%; height:
|
| 54 |
</body>
|
| 55 |
</html>
|
| 56 |
-
""".format(file_url)
|
|
|
|
| 44 |
def chooser():
|
| 45 |
file_url = hf_hub_url(request.args.get("repo_id"), request.args.get("filename"))
|
| 46 |
|
| 47 |
+
if file_url is None:
|
| 48 |
+
return "Invalid URL"
|
| 49 |
+
|
| 50 |
return """
|
| 51 |
<html>
|
| 52 |
<head>
|
| 53 |
<title>Netron</title>
|
| 54 |
</head>
|
| 55 |
<body style="padding: 0; margin: 0; display: flex; flex-direction: row; align-items: center;">
|
| 56 |
+
<iframe id="netron" src="/netron?url={file_url}" style="width: 100%; height: 100%; border: none;"></iframe>
|
| 57 |
</body>
|
| 58 |
</html>
|
| 59 |
+
""".format(file_url = file_url)
|