eyad-silx's picture
Upload upload.py with huggingface_hub
e52aff7 verified
raw
history blame
687 Bytes
from huggingface_hub import HfApi
import os
# Define the repository ID
repo_id = "eyad-silx/Quasar-2.0-7B-Thinking"
# Get the list of all files in the current directory
folder_path = os.getcwd() # Gets the current directory
files = [f for f in os.listdir(folder_path) if os.path.isfile(os.path.join(folder_path, f))]
# Initialize Hugging Face API
api = HfApi()
# Upload each file
for file in files:
file_path = os.path.join(folder_path, file)
print(f"Uploading {file}...")
api.upload_file(
path_or_fileobj=file_path,
path_in_repo=file, # Upload to the root of the repo
repo_id=repo_id,
repo_type="model"
)
print("Upload complete!")