Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -125,8 +125,14 @@ def create_and_push(space_type, hardware, private_space, other_model_name, radio
|
|
| 125 |
os.remove("app.py")
|
| 126 |
|
| 127 |
# Hacking for hackathon. Revert to old gradio version in README.md
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
api.upload_file(
|
| 129 |
-
path_or_fileobj=
|
| 130 |
path_in_repo="README.md",
|
| 131 |
repo_id=model_id,
|
| 132 |
token=token,
|
|
|
|
| 125 |
os.remove("app.py")
|
| 126 |
|
| 127 |
# Hacking for hackathon. Revert to old gradio version in README.md
|
| 128 |
+
readme_file_path = hf_hub_download(repo_id=model_id, filename="README.md")
|
| 129 |
+
with open(readme_file_path, "r") as f:
|
| 130 |
+
readme_content = f.read()
|
| 131 |
+
readme_content.replace("sdk_version: 3.16.1", "sdk_version: 3.10.1")
|
| 132 |
+
with open(readme_file_path, "w") as f:
|
| 133 |
+
f.write(readme_content)
|
| 134 |
api.upload_file(
|
| 135 |
+
path_or_fileobj=readme_file_path,
|
| 136 |
path_in_repo="README.md",
|
| 137 |
repo_id=model_id,
|
| 138 |
token=token,
|