File size: 687 Bytes
e52aff7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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!")