Spaces:
Runtime error
Runtime error
Commit
·
6739d34
1
Parent(s):
cb6d7eb
Update app.py
Browse files
app.py
CHANGED
@@ -185,7 +185,9 @@ def get_all_endpoints(
|
|
185 |
endpoints_df["createdAt"] = endpoints_df["status"].apply(lambda x: x["createdAt"])
|
186 |
endpoints_df["updatedAt"] = endpoints_df["status"].apply(lambda x: x["updatedAt"])
|
187 |
endpoints_df = endpoints_df[["name", "model", "provider", "compute", "status", "minReplica", "maxReplica", "createdAt", "updatedAt"]]
|
188 |
-
return
|
|
|
|
|
189 |
|
190 |
def update_endpoint(
|
191 |
hf_token_input,
|
@@ -229,16 +231,20 @@ with gr.Blocks() as demo2:
|
|
229 |
show_label=False,
|
230 |
type="password"
|
231 |
)
|
232 |
-
gr.
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
)
|
240 |
-
info_button = gr.Button(value="Get Info")
|
241 |
-
info_button.click(get_all_endpoints, inputs=hf_token_input, outputs=endpoints_table)
|
242 |
|
243 |
gr.Markdown(
|
244 |
"""
|
@@ -361,8 +367,8 @@ with gr.Blocks() as demo2:
|
|
361 |
)
|
362 |
|
363 |
security_selector = gr.Radio(
|
364 |
-
choices=["Protected", "Public"
|
365 |
-
value="
|
366 |
interactive=True,
|
367 |
show_label=False,
|
368 |
)
|
|
|
185 |
endpoints_df["createdAt"] = endpoints_df["status"].apply(lambda x: x["createdAt"])
|
186 |
endpoints_df["updatedAt"] = endpoints_df["status"].apply(lambda x: x["updatedAt"])
|
187 |
endpoints_df = endpoints_df[["name", "model", "provider", "compute", "status", "minReplica", "maxReplica", "createdAt", "updatedAt"]]
|
188 |
+
return gr.Dataframe.update(
|
189 |
+
value=endpoints_df
|
190 |
+
)
|
191 |
|
192 |
def update_endpoint(
|
193 |
hf_token_input,
|
|
|
231 |
show_label=False,
|
232 |
type="password"
|
233 |
)
|
234 |
+
with gr.Row():
|
235 |
+
gr.Markdown("""
|
236 |
+
### All Deployed Endpoints
|
237 |
+
""")
|
238 |
+
endpoints_table = gr.Dataframe(
|
239 |
+
headers=["Endpoint Name", "Revision", "Provider", "Instance Type", "Status", "Min Replica", "Max Replica", "Created At", "Updated At"],
|
240 |
+
col_count=(9, "fixed"),
|
241 |
+
)
|
242 |
+
endpoint_info_button = gr.Button(value="Get Info")
|
243 |
+
endpoint_info_button.click(
|
244 |
+
get_all_endpoints,
|
245 |
+
inputs=hf_token_input,
|
246 |
+
outputs=endpoints_table
|
247 |
)
|
|
|
|
|
248 |
|
249 |
gr.Markdown(
|
250 |
"""
|
|
|
367 |
)
|
368 |
|
369 |
security_selector = gr.Radio(
|
370 |
+
choices=["Protected", "Public"],
|
371 |
+
value="Protected",
|
372 |
interactive=True,
|
373 |
show_label=False,
|
374 |
)
|