Spaces:
Running
Running
Update convert.py (#7)
Browse files- Update convert.py (58c27f418b87e6b38c93d16c9e4d8f34b94f4fb9)
- convert.py +4 -7
convert.py
CHANGED
|
@@ -190,13 +190,10 @@ def previous_pr(api: "HfApi", model_id: str, pr_title: str) -> Optional["Discuss
|
|
| 190 |
except Exception:
|
| 191 |
return None
|
| 192 |
for discussion in discussions:
|
| 193 |
-
if
|
| 194 |
-
discussion.
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
and discussion.target_branch == "main"
|
| 198 |
-
):
|
| 199 |
-
return discussion
|
| 200 |
|
| 201 |
|
| 202 |
def convert_generic(model_id: str, folder: str, filenames: Set[str]) -> List["CommitOperationAdd"]:
|
|
|
|
| 190 |
except Exception:
|
| 191 |
return None
|
| 192 |
for discussion in discussions:
|
| 193 |
+
if discussion.status == "open" and discussion.is_pull_request and discussion.title == pr_title:
|
| 194 |
+
details = api.get_discussion_details(repo_id=model_id, discussion_num=discussion.num)
|
| 195 |
+
if details.target_branch == "refs/heads/main":
|
| 196 |
+
return discussion
|
|
|
|
|
|
|
|
|
|
| 197 |
|
| 198 |
|
| 199 |
def convert_generic(model_id: str, folder: str, filenames: Set[str]) -> List["CommitOperationAdd"]:
|