Skip to content

Commit efd7d80

Browse files
committed
fix:github_actions
1 parent 0f96155 commit efd7d80

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/update_space.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,26 @@ jobs:
1212
- name: Set up Python
1313
uses: actions/setup-python@v4
1414
with:
15-
python-version: '3.12.8'
15+
python-version: '3.10'
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install --upgrade pip
19-
pip install huggingface_hub gradio
19+
pip install huggingface_hub
2020
- name: Login to Hugging Face
2121
run: |
2222
echo ${{ secrets.HF_TOKEN }} | huggingface-cli login
2323
- name: Deploy to Spaces
2424
run: |
25-
# Use --yes to automatically accept prompts
26-
gradio deploy --yes
25+
# Create space.yml if it doesn't exist
26+
if [ ! -f "space.yml" ]; then
27+
echo "title: Q-Learning GridWorld Simulator" > space.yml
28+
echo "emoji: 🤖" >> space.yml
29+
echo "colorFrom: blue" >> space.yml
30+
echo "colorTo: green" >> space.yml
31+
echo "sdk: gradio" >> space.yml
32+
echo "sdk_version: 4.0.0" >> space.yml
33+
echo "app_file: rl_gradio.py" >> space.yml
34+
fi
35+
# Push to Hugging Face Space
36+
huggingface-cli repo create fahmizainal17/Q-Learning_GridWorld_Simulator --type space || true
37+
huggingface-cli upload fahmizainal17/Q-Learning_GridWorld_Simulator * --repo-type space

0 commit comments

Comments
 (0)