Spaces:
Sleeping
Sleeping
huangjy-pku
commited on
Commit
•
4038a76
1
Parent(s):
d37fab3
fix hf logging
Browse files
utils.py
CHANGED
@@ -15,7 +15,7 @@ from model.leo_agent import LeoAgentLLM
|
|
15 |
|
16 |
LOG_DIR = 'logs'
|
17 |
MESH_DIR = 'assets/scene_meshes'
|
18 |
-
MESH_NAMES = [os.path.splitext(fname)[0] for fname in os.listdir(MESH_DIR)]
|
19 |
ENABLE_BUTTON = gr.update(interactive=True)
|
20 |
DISABLE_BUTTON = gr.update(interactive=False)
|
21 |
DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
@@ -25,7 +25,6 @@ ROLE_PROMPT = "You are an AI visual assistant situated in a 3D scene. "\
|
|
25 |
"You should properly respond to the USER's instruction according to the given visual information. "
|
26 |
EGOVIEW_PROMPT = "Ego-view image:"
|
27 |
OBJECTS_PROMPT = "Objects (including you) in the scene:"
|
28 |
-
TASK_PROMPT = "USER: {instruction} ASSISTANT:"
|
29 |
OBJ_FEATS_DIR = 'assets/obj_features'
|
30 |
|
31 |
with open('cfg.yaml') as f:
|
@@ -50,11 +49,13 @@ t = datetime.datetime.now()
|
|
50 |
log_fname = os.path.join(LOG_DIR, f'{t.year}-{t.month:02d}-{t.day:02d}-{uuid4()}.json')
|
51 |
|
52 |
if cfg.launch_mode == 'hf':
|
|
|
53 |
scheduler = CommitScheduler(
|
54 |
repo_id=cfg.hf_log_path,
|
55 |
repo_type='dataset',
|
56 |
folder_path=LOG_DIR,
|
57 |
path_in_repo=LOG_DIR,
|
|
|
58 |
)
|
59 |
|
60 |
|
|
|
15 |
|
16 |
LOG_DIR = 'logs'
|
17 |
MESH_DIR = 'assets/scene_meshes'
|
18 |
+
MESH_NAMES = sorted([os.path.splitext(fname)[0] for fname in os.listdir(MESH_DIR)])
|
19 |
ENABLE_BUTTON = gr.update(interactive=True)
|
20 |
DISABLE_BUTTON = gr.update(interactive=False)
|
21 |
DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
|
25 |
"You should properly respond to the USER's instruction according to the given visual information. "
|
26 |
EGOVIEW_PROMPT = "Ego-view image:"
|
27 |
OBJECTS_PROMPT = "Objects (including you) in the scene:"
|
|
|
28 |
OBJ_FEATS_DIR = 'assets/obj_features'
|
29 |
|
30 |
with open('cfg.yaml') as f:
|
|
|
49 |
log_fname = os.path.join(LOG_DIR, f'{t.year}-{t.month:02d}-{t.day:02d}-{uuid4()}.json')
|
50 |
|
51 |
if cfg.launch_mode == 'hf':
|
52 |
+
access_token = os.environ['LOG_ACCESS_TOKEN']
|
53 |
scheduler = CommitScheduler(
|
54 |
repo_id=cfg.hf_log_path,
|
55 |
repo_type='dataset',
|
56 |
folder_path=LOG_DIR,
|
57 |
path_in_repo=LOG_DIR,
|
58 |
+
token=access_token,
|
59 |
)
|
60 |
|
61 |
|