File size: 673 Bytes
8acc7cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Upload only TensorFlow.js model files to Hugging Face Hub
# Usage: python upload_tfjs_to_hub.py

from huggingface_hub import HfApi
import os

# Set these variables
REPO_ID = "harithkavish/SkinNet-Analyzer"  # Your model repo
TFJS_MODEL_DIR = "tfjs_model"  # Path to your tfjs_model directory (containing model.json)

api = HfApi()

# Only upload the tfjs_model directory and its contents
api.upload_folder(
    folder_path=TFJS_MODEL_DIR,
    repo_id=REPO_ID,
    repo_type="model",
    path_in_repo="tfjs_model"  # Uploads to tfjs_model/ in the repo
)

print(f"Uploaded TensorFlow.js model files from '{TFJS_MODEL_DIR}' to '{REPO_ID}/tfjs_model/' on Hugging Face Hub.")