Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ import io
|
|
10 |
app = Flask(__name__)
|
11 |
|
12 |
GITHUB_API = "https://api.github.com/repos/"
|
13 |
-
HF_API = "https://huggingface.co/api/spaces/"
|
14 |
|
15 |
def generate_file_tree(paths):
|
16 |
"""Generate a simple file tree from a list of paths."""
|
@@ -31,7 +31,10 @@ def get_all_files(owner, repo, path="", is_hf=False):
|
|
31 |
api_url = f"{GITHUB_API}{owner}/{repo}/contents/{path}".rstrip('/')
|
32 |
|
33 |
try:
|
|
|
|
|
34 |
response = requests.get(api_url, headers={"Accept": "application/json"})
|
|
|
35 |
response.raise_for_status()
|
36 |
items = response.json()
|
37 |
|
|
|
10 |
app = Flask(__name__)
|
11 |
|
12 |
GITHUB_API = "https://api.github.com/repos/"
|
13 |
+
#HF_API = "https://huggingface.co/api/spaces/"
|
14 |
|
15 |
def generate_file_tree(paths):
|
16 |
"""Generate a simple file tree from a list of paths."""
|
|
|
31 |
api_url = f"{GITHUB_API}{owner}/{repo}/contents/{path}".rstrip('/')
|
32 |
|
33 |
try:
|
34 |
+
response = requests.get(api_url)
|
35 |
+
print(response.content)
|
36 |
response = requests.get(api_url, headers={"Accept": "application/json"})
|
37 |
+
print(str(response.json()))
|
38 |
response.raise_for_status()
|
39 |
items = response.json()
|
40 |
|