Eric Botti commited on
Commit
ec2ecb9
·
1 Parent(s): 0f3ed47

metadata action

Browse files
.github/workflows/push-to-huggingface.yaml CHANGED
@@ -1,4 +1,4 @@
1
- name: Sync to Hugging Face hub
2
  on:
3
  push:
4
  branches: [main]
@@ -7,6 +7,13 @@ on:
7
  workflow_dispatch:
8
 
9
  jobs:
 
 
 
 
 
 
 
10
  sync-to-hub:
11
  runs-on: ubuntu-latest
12
  steps:
@@ -14,6 +21,11 @@ jobs:
14
  with:
15
  fetch-depth: 0
16
  lfs: true
 
 
 
 
 
17
  - name: Push to hub
18
  env:
19
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
1
+ name: Deploy to Hugging Face Spaces
2
  on:
3
  push:
4
  branches: [main]
 
7
  workflow_dispatch:
8
 
9
  jobs:
10
+ update-readme:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - name: Update README
15
+ run: |
16
+ python scripts/update_readme.py
17
  sync-to-hub:
18
  runs-on: ubuntu-latest
19
  steps:
 
21
  with:
22
  fetch-depth: 0
23
  lfs: true
24
+ - name: Update README
25
+ run: |
26
+ python scripts/update_readme.py
27
+ git add README.md
28
+ git commit -m "README metadata"
29
  - name: Push to hub
30
  env:
31
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
README.md CHANGED
@@ -1,14 +1,3 @@
1
- ---
2
- title: Chameleon
3
- emoji: 🦎
4
- colorFrom: green
5
- colorTo: yellow
6
- sdk: streamlit
7
- sdk_version: 1.31.1
8
- app_file: src/app.py
9
- pinned: true
10
- ---
11
-
12
  # Chameleon
13
 
14
  *A social deduction game powered by LLMs*
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Chameleon
2
 
3
  *A social deduction game powered by LLMs*
scripts/update_readme.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ readme_path = "README.md"
4
+
5
+ hf_space_metadata="""
6
+ ---
7
+ title: Chameleon
8
+ emoji: 🦎
9
+ colorFrom: green
10
+ colorTo: yellow
11
+ sdk: streamlit
12
+ sdk_version: 1.31.1
13
+ app_file: src/app.py
14
+ pinned: true
15
+ ---
16
+ """
17
+
18
+ # Open the README file
19
+ with open(readme_path, 'r') as original:
20
+ data = original.read()
21
+ # Rewrite the README file, with metadata prepended
22
+ with open(readme_path, 'w') as modified:
23
+ modified.write(hf_space_metadata + data)