Update app.py
Browse files
app.py
CHANGED
|
@@ -16,13 +16,18 @@ def is_api_up():
|
|
| 16 |
except:
|
| 17 |
return False
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
if st.button("Make list"):
|
| 20 |
start_time = time.time()
|
| 21 |
|
| 22 |
if not is_api_up():
|
| 23 |
st.error("API is not reachable")
|
| 24 |
else:
|
| 25 |
-
r = requests.get(f"{HOST}/
|
| 26 |
library = r.json()["results"]
|
| 27 |
|
| 28 |
models = [model["model_base_name"] for model in library]
|
|
|
|
| 16 |
except:
|
| 17 |
return False
|
| 18 |
|
| 19 |
+
namespace = st.text_input("Namespace", value="library")
|
| 20 |
+
if not namespace:
|
| 21 |
+
namespace = "library"
|
| 22 |
+
st.warn("Namespace cannot be empty!")
|
| 23 |
+
|
| 24 |
if st.button("Make list"):
|
| 25 |
start_time = time.time()
|
| 26 |
|
| 27 |
if not is_api_up():
|
| 28 |
st.error("API is not reachable")
|
| 29 |
else:
|
| 30 |
+
r = requests.get(f"{HOST}/{namespace}")
|
| 31 |
library = r.json()["results"]
|
| 32 |
|
| 33 |
models = [model["model_base_name"] for model in library]
|