Update chatcode/build_notebook.py
Browse files
chatcode/build_notebook.py
CHANGED
|
@@ -77,7 +77,7 @@ The model and datasets have their own pinned revisions in the configuration.
|
|
| 77 |
from google.colab import userdata
|
| 78 |
from huggingface_hub import HfApi, snapshot_download
|
| 79 |
os.environ["HF_TOKEN"] = userdata.get("HF_TOKEN")
|
| 80 |
-
revision =
|
| 81 |
source_dir = Path(snapshot_download(SOURCE_REPO, revision=revision, allow_patterns=[
|
| 82 |
"app.py", "chat.py", "LICENSE*", "chatcode/*.py", "chatcode/*.json", "chatcode/*.txt", "chatcode/*.md"]))
|
| 83 |
assert (source_dir / "chatcode/articles.py").is_file(), "This source commit predates article support."
|
|
|
|
| 77 |
from google.colab import userdata
|
| 78 |
from huggingface_hub import HfApi, snapshot_download
|
| 79 |
os.environ["HF_TOKEN"] = userdata.get("HF_TOKEN")
|
| 80 |
+
revision = HfApi().model_info(SOURCE_REPO, revision=SOURCE_REVISION or "main").sha
|
| 81 |
source_dir = Path(snapshot_download(SOURCE_REPO, revision=revision, allow_patterns=[
|
| 82 |
"app.py", "chat.py", "LICENSE*", "chatcode/*.py", "chatcode/*.json", "chatcode/*.txt", "chatcode/*.md"]))
|
| 83 |
assert (source_dir / "chatcode/articles.py").is_file(), "This source commit predates article support."
|