Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import streamlit as st
|
|
| 2 |
import pandas as pd
|
| 3 |
import requests
|
| 4 |
import os
|
|
|
|
| 5 |
|
| 6 |
HOST = os.getenv("HOST", "https://1tsnakers-ollamasearchapi.hf.space")
|
| 7 |
|
|
@@ -12,6 +13,7 @@ def is_api_up():
|
|
| 12 |
return r.status_code == 200
|
| 13 |
|
| 14 |
if st.button("make list"):
|
|
|
|
| 15 |
if not is_api_up():
|
| 16 |
st.error(f"HTTP error {r.status_code}")
|
| 17 |
else:
|
|
@@ -36,8 +38,10 @@ if st.button("make list"):
|
|
| 36 |
"model": models,
|
| 37 |
"pull_count": pull_count
|
| 38 |
})
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
| 41 |
|
| 42 |
st.dataframe(
|
| 43 |
df,
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import requests
|
| 4 |
import os
|
| 5 |
+
import time
|
| 6 |
|
| 7 |
HOST = os.getenv("HOST", "https://1tsnakers-ollamasearchapi.hf.space")
|
| 8 |
|
|
|
|
| 13 |
return r.status_code == 200
|
| 14 |
|
| 15 |
if st.button("make list"):
|
| 16 |
+
start_time = time.time()
|
| 17 |
if not is_api_up():
|
| 18 |
st.error(f"HTTP error {r.status_code}")
|
| 19 |
else:
|
|
|
|
| 38 |
"model": models,
|
| 39 |
"pull_count": pull_count
|
| 40 |
})
|
| 41 |
+
end_time = time.time()
|
| 42 |
+
elapsed_time = start_time - end_time
|
| 43 |
+
|
| 44 |
+
st.write(f"{len(models)} models counted in {elapsed_time:.4f} seconds")
|
| 45 |
|
| 46 |
st.dataframe(
|
| 47 |
df,
|