lainlives commited on
Commit
2ac2fa0
·
verified ·
1 Parent(s): ac88c5d

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. llama.py +3 -2
  2. ollama.py +3 -2
  3. start.py +0 -1
llama.py CHANGED
@@ -1,7 +1,7 @@
1
  import subprocess
2
  import os
3
  import shutil
4
- from huggingface_hub.HfApi import upload_folder
5
 
6
 
7
  PARALLEL = "8"
@@ -11,7 +11,8 @@ TEMP_DIR = "llama_build"
11
 
12
 
13
  def upload(folder_path, repo_id, repo_type="model"):
14
- upload_folder(
 
15
  folder_path=folder_path,
16
  repo_id=repo_id,
17
  repo_type=repo_type,
 
1
  import subprocess
2
  import os
3
  import shutil
4
+ from huggingface_hub import HfApi
5
 
6
 
7
  PARALLEL = "8"
 
11
 
12
 
13
  def upload(folder_path, repo_id, repo_type="model"):
14
+ api = HfApi()
15
+ api.upload_folder(
16
  folder_path=folder_path,
17
  repo_id=repo_id,
18
  repo_type=repo_type,
ollama.py CHANGED
@@ -2,7 +2,7 @@ import subprocess
2
  import os
3
  import sys
4
  import shutil
5
- from huggingface_hub.HfApi import upload_folder
6
 
7
 
8
  PARALLEL = "8"
@@ -12,7 +12,8 @@ TEMP_DIR = "/tmp/build"
12
 
13
 
14
  def upload(folder_path, repo_id, repo_type="model"):
15
- upload_folder(
 
16
  folder_path=folder_path,
17
  repo_id=repo_id,
18
  repo_type=repo_type,
 
2
  import os
3
  import sys
4
  import shutil
5
+ from huggingface_hub import HfApi
6
 
7
 
8
  PARALLEL = "8"
 
12
 
13
 
14
  def upload(folder_path, repo_id, repo_type="model"):
15
+ api = HfApi()
16
+ api.upload_folder(
17
  folder_path=folder_path,
18
  repo_id=repo_id,
19
  repo_type=repo_type,
start.py CHANGED
@@ -4,7 +4,6 @@ from datetime import datetime, timedelta
4
 
5
  from fastapi import FastAPI
6
  from apscheduler.schedulers.background import BackgroundScheduler
7
- from huggingface_hub.HfApi import restart_space
8
  import uvicorn
9
 
10
  app = FastAPI()
 
4
 
5
  from fastapi import FastAPI
6
  from apscheduler.schedulers.background import BackgroundScheduler
 
7
  import uvicorn
8
 
9
  app = FastAPI()