File size: 1,446 Bytes
f7c7e26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# import os
# from dotenv import load_dotenv
# from huggingface_hub import hf_hub_download, login

# # Load .env file
# load_dotenv()

# # Get token from environment
# HF_TOKEN = os.getenv("HF_TOKEN")

# # Login (only needed if you don't use huggingface-cli)
# login(token=HF_TOKEN)

# REPO_ID = "deedrop1140/Neroml" # Replace with your repository ID

# def load_file(filename):
#     """
#     Downloads a specified file from the Hugging Face Hub repository.
    
#     Args:
#         filename (str): The name of the file to download from the repository.

#     Returns:
#         str: The local path where the downloaded file is stored.
#     """

#     file_path = hf_hub_download( 
#         repo_id=REPO_ID, 
#         filename=filename, 
#         token=HF_TOKEN # token is loaded from environment
#     )
#     return file_path

from huggingface_hub import hf_hub_download

REPO_ID = "deedrop1140/Neroml"  # Replace with your public repository ID

def load_file(filename):
    """

    Downloads a specified file from a public Hugging Face Hub repository.

    

    Args:

        filename (str): The name of the file to download from the repository.



    Returns:

        str: The local path where the downloaded file is stored.

    """
    file_path = hf_hub_download(
        repo_id=REPO_ID,
        filename=filename  # No token needed for public repos
    )
    return file_path