Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DeepSeek-Prover-V1.5
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
Yutong Wu
DeepSeek-Prover-V1.5
Commits
1d67f68a
Commit
1d67f68a
authored
Sep 10, 2024
by
wyt2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove debug
parent
1bb353c5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
prover/workers/generator.py
+11
-16
No files found.
prover/workers/generator.py
View file @
1d67f68a
...
@@ -47,41 +47,36 @@ class GeneratorProcess(mp.Process):
...
@@ -47,41 +47,36 @@ class GeneratorProcess(mp.Process):
item
.
get
(
'_extra_prompt'
,
str
()),
item
.
get
(
'_extra_prompt'
,
str
()),
])
for
_
,
_
,
item
in
inputs
])
for
_
,
_
,
item
in
inputs
]
]
with
open
(
f
'output_rank_{self.local_rank}'
,
'a'
)
as
f
:
f
.
write
(
'
\n
########## INPUT BEGIN ##########
\n
'
)
# encode inputs
f
.
write
(
model_inputs_text
[
0
])
f
.
write
(
'
\n
########## INPUT END ##########
\n
'
)
model_inputs
=
[
model_inputs
=
[
tokenizer
(
inp
,
return_tensors
=
"pt"
)
.
to
(
model
.
device
)
tokenizer
(
inp
,
return_tensors
=
"pt"
)
.
to
(
model
.
device
)
for
inp
in
model_inputs_text
for
inp
in
model_inputs_text
]
]
# generate
model_outputs
=
[
model_outputs
=
[
model
.
generate
(
**
inp
,
max_new_tokens
=
self
.
max_tokens
,
eos_token_id
=
tokenizer
.
eos_token_id
,
do_sample
=
False
)
model
.
generate
(
**
inp
,
max_new_tokens
=
self
.
max_tokens
,
eos_token_id
=
tokenizer
.
eos_token_id
,
do_sample
=
False
)
for
inp
in
model_inputs
for
inp
in
model_inputs
]
]
# decode outputs
model_outputs
=
[
model_outputs
=
[
tokenizer
.
decode
(
out
[
0
],
skip_special_tokens
=
True
)
tokenizer
.
decode
(
out
[
0
],
skip_special_tokens
=
True
)
for
out
in
model_outputs
for
out
in
model_outputs
]
]
with
open
(
f
'output_rank_{self.local_rank}'
,
'a'
)
as
f
:
f
.
write
(
'
\n
########## RAW OUTPUT BEGIN ##########
\n
'
)
f
.
write
(
model_outputs
[
0
])
f
.
write
(
'
\n
########## RAW OUTPUT END ##########
\n
'
)
# remove inputs in decoding results
model_outputs
=
[
model_outputs
=
[
out
[
len
(
inp
):]
.
strip
()
out
[
len
(
inp
):]
.
strip
()
for
inp
,
out
in
zip
(
model_inputs_text
,
model_outputs
)
for
inp
,
out
in
zip
(
model_inputs_text
,
model_outputs
)
]
]
with
open
(
f
'output_rank_{self.local_rank}'
,
'a'
)
as
f
:
f
.
write
(
'
\n
########## REMOVED OUTPUT BEGIN ##########
\n
'
)
f
.
write
(
model_outputs
[
0
])
f
.
write
(
'
\n
########## REMOVED OUTPUT END ##########
\n
'
)
# extract code snippet
outputs
=
[
self
.
output_func
(
_output
)
for
_output
in
model_outputs
]
outputs
=
[
self
.
output_func
(
_output
)
for
_output
in
model_outputs
]
with
open
(
f
'output_rank_{self.local_rank}'
,
'a'
)
as
f
:
f
.
write
(
'
\n
########## CLEANED OUTPUT BEGIN ##########
\n
'
)
# send to verify
f
.
write
(
outputs
[
0
])
f
.
write
(
'
\n
########## CLEANED OUTPUT END ##########
\n
'
)
with
self
.
lock
:
with
self
.
lock
:
for
(
_
,
request_id
,
_
),
output
in
zip
(
inputs
,
outputs
):
for
(
_
,
request_id
,
_
),
output
in
zip
(
inputs
,
outputs
):
self
.
request_statuses
[
request_id
]
=
output
self
.
request_statuses
[
request_id
]
=
output
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