Upload folder using huggingface_hub
Browse files
llama.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import subprocess
|
| 2 |
import os
|
| 3 |
import shutil
|
| 4 |
-
from huggingface_hub
|
| 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 |
-
|
|
|
|
| 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
|
| 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 |
-
|
|
|
|
| 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()
|