-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick_upload_queue.py
More file actions
34 lines (30 loc) · 921 Bytes
/
Copy pathquick_upload_queue.py
File metadata and controls
34 lines (30 loc) · 921 Bytes
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
import os
from huggingface_hub import HfApi
def load_token():
if os.path.exists('.env'):
with open('.env', 'r') as f:
for line in f:
if line.startswith('HF_TOKEN='):
return line.strip().split('=', 1)[1].strip('"\'')
return os.environ.get('HF_TOKEN')
token = load_token()
api = HfApi(token=token)
files_to_upload = [
"src/core/task_manager.py",
"src/core/channels/telegram_channel.py",
"src/core/processor.py",
"src/core/tools/hackerone_tool.py",
"src/bug_hunter.py",
"config/config.json"
]
for file_path in files_to_upload:
try:
api.upload_file(
path_or_fileobj=file_path,
path_in_repo=file_path,
repo_id='adityavanjre/project-k',
repo_type='space'
)
print(f'SUCCESS: {file_path}')
except Exception as e:
print(f'FAIL {file_path}:', str(e))