wwforonce commited on
Commit
803cf0b
·
1 Parent(s): 3ac499a

fix hf dataset

Browse files
Files changed (2) hide show
  1. start_with_sync.sh +3 -2
  2. sync_storage.py +4 -1
start_with_sync.sh CHANGED
@@ -150,7 +150,7 @@ tar -xzf /tmp/caddy.tar.gz -C /tmp/caddy
150
 
151
 
152
  # Start the Node.js application
153
- git clone https://github.com/waxz/Gemini-CLI-2-API.git /tmp/Gemini-CLI-2-API
154
  git clone https://github.com/waxz/gemini-cli-openai /tmp/gemini-cli-openai
155
 
156
  git clone https://github.com/snailyp/gemini-balance.git /tmp/gemini-balance
@@ -303,7 +303,8 @@ ${HOME}/crypt.sh decrypt ${HOME}/gemini/enc.dev.var.l -e GEMINI_AUTH_ENC_PASS
303
 
304
  cd /tmp/Gemini-CLI-2-API && npm install && node src/api-server.js &
305
  cd /tmp/gemini-balance && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload &
306
- cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8881 --host 0.0.0.0 --env x &
 
307
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8882 --host 0.0.0.0 --env j &
308
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8883 --host 0.0.0.0 --env w &
309
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8884 --host 0.0.0.0 --env l &
 
150
 
151
 
152
  # Start the Node.js application
153
+ git clone https://github.com/waxz/Gemini-CLI-2-API.git /tmp/Gemini-CLI-2-API -b waxz-patch-1
154
  git clone https://github.com/waxz/gemini-cli-openai /tmp/gemini-cli-openai
155
 
156
  git clone https://github.com/snailyp/gemini-balance.git /tmp/gemini-balance
 
303
 
304
  cd /tmp/Gemini-CLI-2-API && npm install && node src/api-server.js &
305
  cd /tmp/gemini-balance && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload &
306
+ cd /tmp/gemini-cli-openai && npm i
307
+ cd /tmp/gemini-cli-openai && cp /tmp/gemini-cli-openai/.dev.var.x .dev.var && npx wrangler dev --port 8881 --host 0.0.0.0 &
308
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8882 --host 0.0.0.0 --env j &
309
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8883 --host 0.0.0.0 --env w &
310
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8884 --host 0.0.0.0 --env l &
sync_storage.py CHANGED
@@ -375,6 +375,7 @@ This repository is automatically managed by the Open WebUI sync system.
375
  if not current_files:
376
  logger.warning("Repository is empty or inaccessible. Nothing to prune.")
377
  return
 
378
 
379
  logger.info(f"Found {len(current_files)} files to preserve.")
380
 
@@ -382,6 +383,9 @@ This repository is automatically managed by the Open WebUI sync system.
382
  with tempfile.TemporaryDirectory() as tmpdir:
383
  logger.info(f"Step 2/5: Downloading current files to a temporary location...")
384
  for file_path in current_files:
 
 
 
385
  self.api.hf_hub_download(
386
  repo_id=self.repo_id,
387
  filename=file_path,
@@ -390,7 +394,6 @@ This repository is automatically managed by the Open WebUI sync system.
390
  local_dir=tmpdir,
391
  local_dir_use_symlinks=False
392
  )
393
-
394
  # 3. Delete the entire repository
395
  logger.warning(f"Step 3/5: Deleting repository '{self.repo_id}'...")
396
  delete_repo(self.repo_id, repo_type="dataset", token=self.token)
 
375
  if not current_files:
376
  logger.warning("Repository is empty or inaccessible. Nothing to prune.")
377
  return
378
+ metadata = self._get_metadata()
379
 
380
  logger.info(f"Found {len(current_files)} files to preserve.")
381
 
 
383
  with tempfile.TemporaryDirectory() as tmpdir:
384
  logger.info(f"Step 2/5: Downloading current files to a temporary location...")
385
  for file_path in current_files:
386
+ if file_path not in metadata["archives"]:
387
+ logger.info(f"Skipping {file_path} (not in archive)")
388
+ continue
389
  self.api.hf_hub_download(
390
  repo_id=self.repo_id,
391
  filename=file_path,
 
394
  local_dir=tmpdir,
395
  local_dir_use_symlinks=False
396
  )
 
397
  # 3. Delete the entire repository
398
  logger.warning(f"Step 3/5: Deleting repository '{self.repo_id}'...")
399
  delete_repo(self.repo_id, repo_type="dataset", token=self.token)