Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
anpl
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ziyuan Nan
anpl
Commits
fb4e2a88
Commit
fb4e2a88
authored
May 09, 2023
by
nzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove namedtuple; Save robotB's code and show Output for user
parent
6ba580bf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
anpl/anpl.py
+0
-1
robotB.py
+6
-1
No files found.
anpl/anpl.py
View file @
fb4e2a88
...
...
@@ -96,7 +96,6 @@ class ANPL:
ENV
=
ast
.
parse
(
'''
import numpy as np
from collections import namedtuple
from typing import *
black, blue, red, green, yellow, grey, pink, orange, teal, maroon = range(10)
'''
)
...
...
robotB.py
View file @
fb4e2a88
from
anpl.synthesizer
import
raw_query
,
msg
from
utils
import
sys_str
,
system_info
,
multiline_input
,
select_task
,
set_openai_key
from
utils
import
sys_str
,
system_info
,
multiline_input
,
select_task
,
set_openai_key
,
rich_dumps
from
rich.prompt
import
IntPrompt
,
Confirm
,
Prompt
from
rich
import
print
from
anpl.sandbox
import
import_module_from_string
...
...
@@ -78,10 +78,15 @@ while not is_correct:
if
np
.
array_equal
(
out
,
real_out
):
logger
.
log
(
"system"
,
"check"
,
f
"correct"
)
system_info
(
"[green] Code CORRECT [/green]"
)
time_str
=
time
.
strftime
(
"
%
Y
%
m
%
d_
%
H
%
M
%
S"
)
with
open
(
f
"./log/btask{task_id}_{time_str}.py"
,
"w"
)
as
f
:
f
.
write
(
code
)
is_correct
=
True
else
:
logger
.
log
(
"system"
,
"check"
,
f
"wrong"
)
system_info
(
"[red] Code WRONG [/red]"
)
print
(
"The output is"
)
print
(
rich_dumps
(
out
))
else
:
quit_time
=
time
.
time
()
if
quit_time
-
logger
.
start_time
<
30
*
60
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment