Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,6 +32,10 @@ def get_repo_info(repo_id):
|
|
| 32 |
dataset_response = requests.get(f"https://huggingface.co/api/datasets/{repo_id}")
|
| 33 |
if dataset_response.status_code == 200:
|
| 34 |
return dataset_response.json(), "dataset"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
return None, None
|
| 37 |
except Exception as e:
|
|
@@ -97,7 +101,7 @@ with gr.Blocks(theme="NeoPy/Syne", title="HF Repo README Generator") as demo:
|
|
| 97 |
submit_btn = gr.Button("Generate README", variant="primary")
|
| 98 |
|
| 99 |
with gr.Row():
|
| 100 |
-
output = gr.
|
| 101 |
|
| 102 |
submit_btn.click(
|
| 103 |
fn=generate_readme,
|
|
|
|
| 32 |
dataset_response = requests.get(f"https://huggingface.co/api/datasets/{repo_id}")
|
| 33 |
if dataset_response.status_code == 200:
|
| 34 |
return dataset_response.json(), "dataset"
|
| 35 |
+
# Try Spaces endpoint
|
| 36 |
+
spaces_response = requests.get(f"https://huggingface.co/api/spaces/{repo_id}")
|
| 37 |
+
if spaces_response.status_code == 200:
|
| 38 |
+
return spaces_response.json(), "dataset"
|
| 39 |
|
| 40 |
return None, None
|
| 41 |
except Exception as e:
|
|
|
|
| 101 |
submit_btn = gr.Button("Generate README", variant="primary")
|
| 102 |
|
| 103 |
with gr.Row():
|
| 104 |
+
output = gr.Textbox(label="Generated README", lines=20, interactive=True)
|
| 105 |
|
| 106 |
submit_btn.click(
|
| 107 |
fn=generate_readme,
|