Akshit Chaturvedi commited on
Commit
c840ff5
Β·
1 Parent(s): 30fe508

Updated readme

Browse files
Files changed (3) hide show
  1. .gitattributes +0 -1
  2. .github/workflows/sync-to-hf-space.yml +19 -76
  3. README.md +10 -10
.gitattributes DELETED
@@ -1 +0,0 @@
1
- images/*.png filter=lfs diff=lfs merge=lfs -text
 
 
.github/workflows/sync-to-hf-space.yml CHANGED
@@ -2,101 +2,44 @@
2
  name: Sync to Hugging Face Space
3
 
4
  on:
5
- push: all history
6
- lfs: false # Checkout LFS pointers first, then explicitly fetch
7
-
8
- - name: Setup Git LFS
9
- run: |
10
- git lfs install --system --skip-repo # Install LFS
11
  branches:
12
- - main
13
 
14
  jobs:
15
  sync:
16
  runs-on: ubuntu-latest
17
  steps:
18
  - name: Checkout repository
19
- uses: actions/checkout@v4
20
  with:
21
- fetch-depth: 0 # Fetch all history initially, we might not push it all to HF
22
- lfs: true # Ensure LFS files are checked out
23
-
24
- - name: Install Git LFS
25
- run: | globally
26
- echo "Git LFS installed"
27
-
28
- - name: Fetch LFS files from origin (GitHub)
29
- # This step ensures the runner downloads the actual LFS file content
30
- # associated with the pointers checked out in the previous step.
31
- run: |
32
- git lfs fetch --all origin
33
- git lfs checkout # This replaces pointers with actual files
34
- echo "LFS files fetched and checked out"
35
- git lfs ls-files # List LFS files to confirm they are present
36
-
37
- - name: Push to Hugging Face Space
38
- env:
39
-
40
- git lfs install --skip-repo # Initialize LFS for the git commands
41
 
42
  - name: Push to Hugging Face Space
43
  env:
44
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
45
- SPACE_ID: GuitarGoogle/Prophet-commodity-stock-analysis # Corrected username based on previous context
46
- run:HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
47
  SPACE_ID: GuitarGeorge/Prophet-commodity-stock-analysis
48
  run: |
49
  echo "Attempting to push to Hugging Face Space: $SPACE_ID"
 
 
 
50
 
51
- git config --global user.email "[email protected]"
52
- git config --global user |
53
- echo "Attempting to push to Hugging Face Space: $SPACE_ID"
54
 
 
55
  git config --global user.email "[email protected]"
56
  git config --global user.name "GitHub Action"
57
-
58
- # Set up the Hugging Face remote
59
- # Using dummy username as the token should handle.name "GitHub Action"
60
-
61
- # Add Hugging Face remote. Using a distinct name for the user part can help.
62
- # The token is the password.
63
- git remote add hf_space "https://hf_ auth
64
- git remote add hf_space "https://dummy:${HF_TOKEN}@huggingface.co/spaces/${SPACE_ID}"
65
- git remote -v
66
-
67
- # Ensure local LFS files are present (fetched from originaction_user:${HF_TOKEN}@huggingface.co/spaces/${SPACE_ID}"
68
- git remote -v
69
-
70
- # Explicitly tell Git to use Hugging Face's LFS transfer agent for this remote.
71
- # during checkout with lfs:true)
72
- # If checkout with lfs:true is insufficient, explicitly fetch:
73
- This is often a key step.
74
- git config lfs.https://huggingface.co/spaces/${# echo "Fetching LFS objects from origin (GitHub)..."
75
- # git lfs fetch --all origin
76
-
77
- SPACE_ID}.git/info/lfs.locksverify true
78
- git config lfs.https://huggingface# Explicitly push LFS objects to the Hugging Face remote first
79
- echo "Pushing LFS objects to h.co/spaces/${SPACE_ID}.git/info/lfs.access hf_transfer
80
-
81
- # Push Lf_space (Hugging Face)..."
82
- git lfs push --all hf_space
83
-
84
- #FS objects specifically to the Hugging Face remote.
85
- # This ensures the LFS files are uploaded to HF's LFS storage.
86
- echo "Pushing LFS objects to hf_space..."
87
- git lfs push --all hf_space
88
- # As a diagnostic, check if LFS thinks they are uploaded for this remote:
89
- # git Strategy: Try to push the current commit (HEAD) as a fresh 'main' branch to Hugging Face
90
- # This attempts to overwrite the 'main' branch on HF with only the current commit's state and its direct LFS pointers.
91
- # It might sever the history on the HF remote from its previous state if the histories are incompatible,
92
- # which could be what's needed if old commits are causing the pre-receive hook to fail.
93
- echo "Push lfs ls-files | awk '{print $1}' | xargs git lfs check Pushed to hf_space
94
-
95
- # Push the Git references (commits, LFS pointers).
96
- echo "Pushing Git references to hf_space..."
97
- git push --force hf_space HEAD:refs/heads/main
98
 
99
- echo "ing Git references (current HEAD as main) to hf_space..."
100
- git push --force hf_space HEAD:refs/heads/main
 
 
 
 
101
 
102
  echo "Push to Hugging Face Space completed."
 
2
  name: Sync to Hugging Face Space
3
 
4
  on:
5
+ push:
 
 
 
 
 
6
  branches:
7
+ - main # Or whatever your default branch is
8
 
9
  jobs:
10
  sync:
11
  runs-on: ubuntu-latest
12
  steps:
13
  - name: Checkout repository
14
+ uses: actions/checkout@v3
15
  with:
16
+ fetch-depth: 0 # Fetch all history for accurate diffs
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  - name: Push to Hugging Face Space
19
  env:
20
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
21
+ # Your Hugging Face username
22
+ HF_USERNAME: GuitarGeorge
23
+ # The ID of your Space (username/space-name)
24
  SPACE_ID: GuitarGeorge/Prophet-commodity-stock-analysis
25
  run: |
26
  echo "Attempting to push to Hugging Face Space: $SPACE_ID"
27
+ # Add Hugging Face as a remote
28
+ # The username in the URL is important for Git to use the correct token
29
+ git remote add hf_space "https://dummy:${HF_TOKEN}@huggingface.co/spaces/${SPACE_ID}"
30
 
31
+ # Check if the remote was added
32
+ git remote -v
 
33
 
34
+ # Configure Git user (sometimes needed in CI, though token auth often bypasses this need for commit identity)
35
  git config --global user.email "[email protected]"
36
  git config --global user.name "GitHub Action"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ # Attempt to push. Using -f to force push might be needed if the histories diverge,
39
+ # but be cautious. A safer approach is to ensure clean history.
40
+ # For a simple sync, `git push hf_space main` might be enough if main on HF mirrors main on GitHub.
41
+ # If you want to ensure the Space always reflects the GitHub main branch, a force push is common.
42
+ # Be aware that force push overwrites the history on the remote.
43
+ git push --force hf_space HEAD:refs/heads/main
44
 
45
  echo "Push to Hugging Face Space completed."
README.md CHANGED
@@ -83,30 +83,30 @@ The following table summarizes the performance metrics observed for each ticker
83
  *(These plots illustrate how the model's forecast (blue line) and confidence interval (shaded area) compared against the actual test data (black dots) during a historical backtest run.)*
84
 
85
  **DBA - Test Forecast vs. Actuals**
86
- ![DBA Test Forecast](images/DBA_test_forecast_vs_actual.png)
87
 
88
  **FCX - Test Forecast vs. Actuals**
89
- ![FCX Test Forecast](images/FCX_test_forecast_vs_actual.png)
 
90
 
91
  **GLD - Test Forecast vs. Actuals**
92
- ![GLD Test Forecast](images/GLD_test_forecast_vs_actual.png)
 
93
 
94
  **NEM - Test Forecast vs. Actuals**
95
- ![NEM Test Forecast](images/NEM_test_forecast_vs_actual.png)
96
 
97
  **SLV - Test Forecast vs. Actuals**
98
- ![SLV Test Forecast](images/SLV_test_forecast_vs_actual.png)
99
 
100
  **UNG - Test Forecast vs. Actuals**
101
- ![UNG Test Forecast](images/UNG_test_forecast_vs_actual.png)
102
 
103
  **USO - Test Forecast vs. Actuals**
104
- ![USO Test Forecast](images/USO_test_forecast_vs_actual.png)
105
-
106
- ![XOM Test Forecast](https://drive.google.com/uc?export=view&id=112aylZnv3NKTUQWz5HrU2hsRwaNSymMg)
107
 
108
  **XOM - Test Forecast vs. Actuals**
109
- ![XOM Test Forecast](images/XOM_test_forecast_vs_actual.png)
110
 
111
  *(Image for XOM provided shows a wide confidence interval, indicating high uncertainty in the long-term forecast for this particular backtest period).*
112
 
 
83
  *(These plots illustrate how the model's forecast (blue line) and confidence interval (shaded area) compared against the actual test data (black dots) during a historical backtest run.)*
84
 
85
  **DBA - Test Forecast vs. Actuals**
86
+ ![DBA Test Forecast](https://drive.google.com/uc?export=view&id=112aylZnv3NKTUQWz5HrU2hsRwaNSymMg)
87
 
88
  **FCX - Test Forecast vs. Actuals**
89
+ ![FCX Test Forecast](https://drive.google.com/uc?export=view&id=10n3XTm9Rsg02_kEL6BcMn3gCUHX_Ws9s)
90
+ )
91
 
92
  **GLD - Test Forecast vs. Actuals**
93
+ ![GLD Test Forecast](https://drive.google.com/uc?export=view&id=10u1NiRooMPFsKzuSazP6JmIq6os94nyx)
94
+ )
95
 
96
  **NEM - Test Forecast vs. Actuals**
97
+ ![NEM Test Forecast](https://drive.google.com/uc?export=view&id=10w2mCXzsBy6mciHzVLuG_Zhm00cFEGgu)
98
 
99
  **SLV - Test Forecast vs. Actuals**
100
+ ![SLV Test Forecast](https://drive.google.com/uc?export=view&id=10rWqezVNT6-6XVNyfe6YYrsOwiQ3pmH)
101
 
102
  **UNG - Test Forecast vs. Actuals**
103
+ ![UNG Test Forecast](https://drive.google.com/uc?export=view&id=10mM2ldm3ITnEGf9hHlLHfnWfhkjjxlOB)
104
 
105
  **USO - Test Forecast vs. Actuals**
106
+ ![USO Test Forecast](https://drive.google.com/uc?export=view&id=10mmxq7bX-stgWfp6PzABEVCuLW83K8Vc)
 
 
107
 
108
  **XOM - Test Forecast vs. Actuals**
109
+ ![XOM Test Forecast](https://drive.google.com/uc?export=view&id=110TK2aASouWvpRfiifVo8M5w5OEN7xv_)
110
 
111
  *(Image for XOM provided shows a wide confidence interval, indicating high uncertainty in the long-term forecast for this particular backtest period).*
112