Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import sys
|
|
| 3 |
import uuid
|
| 4 |
import gradio as gr
|
| 5 |
import requests
|
|
|
|
| 6 |
from pathlib import Path
|
| 7 |
from huggingface_hub import (create_repo,get_full_repo_name,upload_file,CommitOperationAdd,HfApi)
|
| 8 |
uid = uuid.uuid4()
|
|
@@ -26,8 +27,17 @@ def show_f(model_id,d_app,token):
|
|
| 26 |
author=model_id.split("/",1)[0]
|
| 27 |
s_ist = (api.list_spaces(author=author))
|
| 28 |
print (s_ist)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
|
|
|
| 31 |
if key == 'id':
|
| 32 |
print (value)
|
| 33 |
|
|
|
|
| 3 |
import uuid
|
| 4 |
import gradio as gr
|
| 5 |
import requests
|
| 6 |
+
import json
|
| 7 |
from pathlib import Path
|
| 8 |
from huggingface_hub import (create_repo,get_full_repo_name,upload_file,CommitOperationAdd,HfApi)
|
| 9 |
uid = uuid.uuid4()
|
|
|
|
| 27 |
author=model_id.split("/",1)[0]
|
| 28 |
s_ist = (api.list_spaces(author=author))
|
| 29 |
print (s_ist)
|
| 30 |
+
par = json.loads(s_ist)
|
| 31 |
+
keyVal='id'
|
| 32 |
+
for key, value in enumerate(s_ist):
|
| 33 |
+
# Search the key value using 'in' operator
|
| 34 |
+
if keyVal in par:
|
| 35 |
+
# Print the success message and the value of the key
|
| 36 |
+
print("%s is found in JSON data" %keyVal)
|
| 37 |
+
print("The value of", keyVal,"is", par[keyVal])
|
| 38 |
|
| 39 |
+
|
| 40 |
+
|
| 41 |
if key == 'id':
|
| 42 |
print (value)
|
| 43 |
|