Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Speech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
Skills
Speech
Commits
7b4b149a
Commit
7b4b149a
authored
6 months ago
by
Leonard Bärmann
Browse files
Options
Downloads
Patches
Plain Diff
Determine whether to wrap tree loaded from pickle or if it's already in the correct format
parent
74ba18c2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/skills/skills/episodic_verbalization.py
+11
-2
11 additions, 2 deletions
python/skills/skills/episodic_verbalization.py
with
11 additions
and
2 deletions
python/skills/skills/episodic_verbalization.py
+
11
−
2
View file @
7b4b149a
...
...
@@ -2,7 +2,7 @@ from pathlib import Path
import
pickle
import
logging
from
episodic_verbalization_core.em.em_tree
import
HigherLevelSummary
from
episodic_verbalization_core.em.em_tree
import
HigherLevelSummary
,
GoalBasedSummary
from
episodic_verbalization_core.lmp.setup
import
instantiate_llm
from
episodic_verbalization_core.em.armarx_lt_mem
import
load_episode_from_armarx_lt_mem
,
extend_existing_history_from_memory_snapshots
from
episodic_verbalization_core.em.llm_summary
import
LLMBasedSummarizer
...
...
@@ -28,7 +28,16 @@ class EM_Verbalization_Tree:
# load tree:
if
self
.
history_cache
.
is_file
():
print
(
'
loading tree from
'
,
self
.
history_cache
)
self
.
tree
=
HigherLevelSummary
(
''
,
children
=
[
pickle
.
loads
(
self
.
history_cache
.
read_bytes
())])
tree
=
pickle
.
loads
(
self
.
history_cache
.
read_bytes
())
assert
type
(
tree
).
__name__
==
HigherLevelSummary
.
__name__
if
type
(
tree
.
children
[
-
1
]).
__name__
==
HigherLevelSummary
.
__name__
:
# this tree already seems to be in the correct format
self
.
tree
=
tree
elif
all
(
type
(
c
).
__name__
==
GoalBasedSummary
.
__name__
for
c
in
tree
.
children
):
# this tree should be wrapped
self
.
tree
=
HigherLevelSummary
(
''
,
children
=
[])
else
:
raise
ValueError
(
'
Unsupported tree file
'
+
str
(
self
.
history_cache
))
else
:
print
(
'
could not load tree from
'
,
self
.
history_cache
)
self
.
create_tree
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment