Pratik Bokade commited on
Commit
7b97c90
·
1 Parent(s): b14c653

Update main.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/main.yml +18 -9
.github/workflows/main.yml CHANGED
@@ -2,6 +2,8 @@ name: Sync to Hugging Face Space
2
  on:
3
  push:
4
  branches: [main]
 
 
5
  workflow_dispatch:
6
 
7
  jobs:
@@ -10,8 +12,8 @@ jobs:
10
  steps:
11
  - uses: actions/checkout@v3
12
  with:
13
- fetch-depth: 0
14
- lfs: true
15
 
16
  - name: Install git-filter-repo
17
  run: pip install git-filter-repo
@@ -19,10 +21,17 @@ jobs:
19
  - name: Remove large file from history
20
  run: git filter-repo --path "Rag_Documents/layout-parser-paper.pdf" --invert-paths --force
21
 
22
- - name: Push to Hugging Face Spaces
23
- uses: huggingface/huggingface_hub@main
24
- with:
25
- target_repo: bpratik/Chatbot
26
- token: ${{ secrets.HF_TOKEN }}
27
- repo_type: space
28
- space_sdk: streamlit
 
 
 
 
 
 
 
 
2
  on:
3
  push:
4
  branches: [main]
5
+
6
+ # to run this workflow manually from the Actions tab
7
  workflow_dispatch:
8
 
9
  jobs:
 
12
  steps:
13
  - uses: actions/checkout@v3
14
  with:
15
+ fetch-depth: 0 # Required for history rewriting
16
+ lfs: true # Enable Git LFS support
17
 
18
  - name: Install git-filter-repo
19
  run: pip install git-filter-repo
 
21
  - name: Remove large file from history
22
  run: git filter-repo --path "Rag_Documents/layout-parser-paper.pdf" --invert-paths --force
23
 
24
+ - name: Log in to Hugging Face Hub
25
+ env:
26
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
27
+ run: |
28
+ pip install -U "huggingface_hub>=0.20.0"
29
+ git config --global credential.helper store
30
+ echo "https://bpratik:$HF_TOKEN@huggingface.co" > ~/.git-credentials
31
+
32
+ - name: Push to hub
33
+ env:
34
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
35
+ run: |
36
+ git remote add hf https://huggingface.co/spaces/bpratik/Chatbot
37
+ git push --force hf main