Commit
·
2092506
1
Parent(s):
b23258f
install local transformers
Browse files
app.py
CHANGED
|
@@ -448,6 +448,11 @@ if not os.path.exists(repo_dir):
|
|
| 448 |
import subprocess
|
| 449 |
|
| 450 |
subprocess.run(["git", "clone", "https://github.com/huggingface/transformers.git", repo_dir], check=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 451 |
|
| 452 |
docs_dir = os.path.join(repo_dir, "docs", "source", "en", "model_doc")
|
| 453 |
docs_dir = os.path.abspath(docs_dir)
|
|
|
|
| 448 |
import subprocess
|
| 449 |
|
| 450 |
subprocess.run(["git", "clone", "https://github.com/huggingface/transformers.git", repo_dir], check=True)
|
| 451 |
+
subprocess.run(["pip", "install", "-e", repo_dir], check=True)
|
| 452 |
+
else:
|
| 453 |
+
# fetch the latest changes and pull them
|
| 454 |
+
subprocess.run(["git", "fetch", "--all", "--prune"], cwd=repo_dir, check=True)
|
| 455 |
+
subprocess.run(["git", "pull", "origin", "main"], cwd=repo_dir, check=True)
|
| 456 |
|
| 457 |
docs_dir = os.path.join(repo_dir, "docs", "source", "en", "model_doc")
|
| 458 |
docs_dir = os.path.abspath(docs_dir)
|