abc1181 commited on
Commit
1b68410
·
verified ·
1 Parent(s): b6724be

Update start_server.sh

Browse files
Files changed (1) hide show
  1. start_server.sh +9 -14
start_server.sh CHANGED
@@ -15,20 +15,15 @@ sed -i "s/#COMMIT#/$COMMIT/" nginx.conf
15
  sed -i "s/#PORT#/$PORT/" nginx.conf
16
  nginx -c $PWD/nginx.conf
17
 
18
- set +e
19
- if [[ ! -z "$REPO" ]]; then
20
- dir=$(basename "$REPO" .git)
21
- echo start to clone initial repo $REPO into $dir
22
- git clone --progress $REPO $dir
23
- cd $dir
24
- git config --global user.name "$(git log -1 --pretty=format:'%an')"
25
- git config --global user.email "$(git log -1 --pretty=format:'%ae')"
26
- cd ..
27
- else
28
- git config --global user.name "$SPACE_AUTHOR_NAME"
29
- git config --global user.email "$SPACE_AUTHOR_NAME@hf.co"
30
- fi
31
 
 
 
 
 
 
 
32
  git config --global http.postBuffer 524288000
33
 
34
  echo "Starting VSCode Server..."
@@ -38,4 +33,4 @@ $vscode --install-extension ms-toolsai.jupyter
38
  $vscode --install-extension ms-python.python
39
  ln -s $vscode_cli $(dirname $vscode_cli)/code
40
  set -e
41
- exec $vscode --host 0.0.0.0 --port 5050 --without-connection-token \"${@}\" --
 
15
  sed -i "s/#PORT#/$PORT/" nginx.conf
16
  nginx -c $PWD/nginx.conf
17
 
18
+ # Install huggingface_hub if not present
19
+ pip install -q huggingface_hub 2>/dev/null
 
 
 
 
 
 
 
 
 
 
 
20
 
21
+ # Start HF dataset sync in background
22
+ echo "Starting HF dataset sync..."
23
+ python3 scripts/sync_hf.py &
24
+
25
+ git config --global user.name "$SPACE_AUTHOR_NAME"
26
+ git config --global user.email "$SPACE_AUTHOR_NAME@hf.co"
27
  git config --global http.postBuffer 524288000
28
 
29
  echo "Starting VSCode Server..."
 
33
  $vscode --install-extension ms-python.python
34
  ln -s $vscode_cli $(dirname $vscode_cli)/code
35
  set -e
36
+ exec $vscode --host 0.0.0.0 --port 5050 --without-connection-token "${@}" --