Update README to include instructions to set HUgging Face repo
Browse files
README.md
CHANGED
@@ -6,64 +6,88 @@ Set the Cookiecutter-MLOps in Hugging Face
|
|
6 |
==============================================
|
7 |
|
8 |
1. Create Model repository in Hugging Face (e.g. myHFrepo)
|
9 |
-
2.
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
15 |
|
16 |
-
For ssh connection check here
|
17 |
cd myHFrepo
|
18 |
python -m venv jointvenv
|
19 |
-
|
20 |
source jointvenv/bin/activate
|
21 |
|
22 |
-
|
23 |
-
|
24 |
git clone https://dagshub.com/DagsHub/Cookiecutter-MLOps.git
|
|
|
|
|
|
|
25 |
rm -r /path/to/myHFrepo/Cookiecutter-MLOps/.git
|
|
|
|
|
|
|
26 |
cat /path/to/myHFrepo/Cookiecutter-MLOps/.gitattributes >> /path/to/myHFrepo/.gitattributes
|
27 |
rm /path/to/myHFrepo/Cookiecutter-MLOps/.gitattributes
|
28 |
-
cat /path/to/myHFrepo/Cookiecutter-MLOps/README >> /path/to/myHFrepo/README
|
29 |
-
rm /path/to/myHFrepo/Cookiecutter-MLOps/README
|
30 |
-
git add README.md
|
31 |
-
git commit -m "Paste README info from DagsHub/Cookiecutter-MLOps"
|
32 |
git add .gitattributes
|
33 |
git commit -m "Paste .gitattributes info from DagsHub/Cookiecutter-MLOps"
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
rm -r /path/to/myHFrepo/Cookiecutter-MLOps
|
|
|
|
|
|
|
38 |
echo '' >> .gitignore
|
39 |
echo '#'Virtual Environment >> .gitignore
|
40 |
-
echo jointvenv/ >> .gitignore
|
41 |
git add .
|
42 |
git commit -m "add remaining DagsHub/Cookiecutter-MLOps repo content"
|
|
|
|
|
|
|
43 |
make dirs
|
44 |
-
make requirements
|
45 |
-
mv requirements.txt requirementsCookiecutter-MLOps.txt
|
46 |
-
git add requirementsCookiecutter-MLOps.txt
|
47 |
-
git commit -m "external requirements from Cookiecutter-
|
48 |
-
MLOps"
|
49 |
-
pip freeze > requirements.txt
|
50 |
-
git add requirements.txt
|
51 |
-
git commit -m "First report venv requirements"
|
52 |
-
git push origin main
|
53 |
-
|
54 |
-
Create Model repository in your Hugging Face organization (e.g. myHFrepo)
|
55 |
-
|
56 |
-
git remote add dcc git@hf.co:MYORG/mywslHFrepo
|
57 |
-
git pull dcc main --allow-unrelated-histories
|
58 |
-
Resolve conflicts in .gitattributes and README.md
|
59 |
-
git add .
|
60 |
-
git commit -m "Merge HuggingFace individual and organization repos"
|
61 |
-
git push dcc main
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
|
|
|
|
|
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
Cookiecutter-MLOps
|
68 |
==============================
|
69 |
|
|
|
6 |
==============================================
|
7 |
|
8 |
1. Create Model repository in Hugging Face (e.g. myHFrepo)
|
9 |
+
2. Clone your Hugging face repo to your local directory:
|
10 |
|
11 |
+
cd /path/to/parent directory of project folder
|
12 |
+
git clone git@hf.co:USERNAME/myHFrepo
|
13 |
+
|
14 |
+
For ssh connection check [here](https://huggingface.co/docs/hub/security-git-ssh#add-a-ssh-key-to-your-account)
|
15 |
+
|
16 |
+
3. Create your virtual environment (e.g. jointvenv)
|
17 |
|
|
|
18 |
cd myHFrepo
|
19 |
python -m venv jointvenv
|
|
|
20 |
source jointvenv/bin/activate
|
21 |
|
22 |
+
4. Transfer and set DagsHub's cookiecutter template employing MLOps best practices to your Huggingface repo
|
23 |
+
|
24 |
git clone https://dagshub.com/DagsHub/Cookiecutter-MLOps.git
|
25 |
+
|
26 |
+
4.1 Delete git files cloned from Cookiecutter-MLOps repo
|
27 |
+
|
28 |
rm -r /path/to/myHFrepo/Cookiecutter-MLOps/.git
|
29 |
+
|
30 |
+
4.2 dResolve conflicts with .gitattributes and README.md
|
31 |
+
|
32 |
cat /path/to/myHFrepo/Cookiecutter-MLOps/.gitattributes >> /path/to/myHFrepo/.gitattributes
|
33 |
rm /path/to/myHFrepo/Cookiecutter-MLOps/.gitattributes
|
|
|
|
|
|
|
|
|
34 |
git add .gitattributes
|
35 |
git commit -m "Paste .gitattributes info from DagsHub/Cookiecutter-MLOps"
|
36 |
+
|
37 |
+
cat /path/to/myHFrepo/Cookiecutter-MLOps/README.md >> /path/to/myHFrepo/README.md
|
38 |
+
rm /path/to/myHFrepo/Cookiecutter-MLOps/README.md
|
39 |
+
git add README.md
|
40 |
+
git commit -m "Paste README info from DagsHub/Cookiecutter-MLOps"
|
41 |
+
|
42 |
+
4.3 Move remaining files from DagsHub/Cookiecutter-MLOps yo your Hugging Face repo .gitattributes and README.md
|
43 |
+
|
44 |
+
cd /path/to/myHFrepo/Cookiecutter-MLOps
|
45 |
+
mv * .[^.]* ..
|
46 |
+
cd /path/to/myHFrepo
|
47 |
rm -r /path/to/myHFrepo/Cookiecutter-MLOps
|
48 |
+
|
49 |
+
5. Add venv folder to.gitignore
|
50 |
+
|
51 |
echo '' >> .gitignore
|
52 |
echo '#'Virtual Environment >> .gitignore
|
53 |
+
echo jointvenv/ >> .gitignore
|
54 |
git add .
|
55 |
git commit -m "add remaining DagsHub/Cookiecutter-MLOps repo content"
|
56 |
+
|
57 |
+
6. Run step 2 from DagsHub/Cookiecutter-MLOps
|
58 |
+
|
59 |
make dirs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
+
7. Run step 4 from DagsHub/Cookiecutter-MLOps
|
62 |
+
|
63 |
+
make requirements
|
64 |
+
|
65 |
+
8. Keep record of your own requirements
|
66 |
+
|
67 |
+
mv requirements.txt requirementsCookiecutter-MLOps.txt
|
68 |
+
git add requirementsCookiecutter-MLOps.txt
|
69 |
+
git commit -m "external requirements from Cookiecutter-MLOps"
|
70 |
|
71 |
+
pip freeze > requirements.txt
|
72 |
+
git add requirements.txt
|
73 |
+
git commit -m "First report venv requirements"
|
74 |
|
75 |
+
9. Push your changes to the remote Hugging face repository
|
76 |
|
77 |
+
git push origin main
|
78 |
|
79 |
+
10. Optional Create Model repository in your Hugging Face organization (e.g. myHFrepo)
|
80 |
+
|
81 |
+
git remote add dcc git@hf.co:MYORG/mywslHFrepo
|
82 |
+
git pull dcc main --allow-unrelated-histories
|
83 |
+
|
84 |
+
Resolve conflicts in .gitattributes and README.md
|
85 |
+
|
86 |
+
git add .
|
87 |
+
git commit -m "Merge HuggingFace individual and organization repos"
|
88 |
+
git push dcc main
|
89 |
+
|
90 |
+
==============================
|
91 |
Cookiecutter-MLOps
|
92 |
==============================
|
93 |
|