Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
opencompass
Commits
6e885d66
"...composable_kernel.git" did not exist on "e9d4e893e589ca2e2588365bee4ff3fe59408ce6"
Unverified
Commit
6e885d66
authored
Jul 25, 2023
by
Haodong Duan
Committed by
GitHub
Jul 25, 2023
Browse files
force utf-8 encoding for all non-dataset fileios (#97)
parent
3fe5ee09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
opencompass/openicl/icl_retriever/icl_votek_retriever.py
opencompass/openicl/icl_retriever/icl_votek_retriever.py
+1
-1
opencompass/utils/summarizer.py
opencompass/utils/summarizer.py
+2
-2
No files found.
opencompass/openicl/icl_retriever/icl_votek_retriever.py
View file @
6e885d66
...
@@ -42,7 +42,7 @@ class VotekRetriever(TopkRetriever):
...
@@ -42,7 +42,7 @@ class VotekRetriever(TopkRetriever):
vote_file
=
None
):
vote_file
=
None
):
n
=
len
(
embeddings
)
n
=
len
(
embeddings
)
if
vote_file
is
not
None
and
os
.
path
.
isfile
(
vote_file
):
if
vote_file
is
not
None
and
os
.
path
.
isfile
(
vote_file
):
with
open
(
vote_file
)
as
f
:
with
open
(
vote_file
,
encoding
=
'utf-8'
)
as
f
:
vote_stat
=
json
.
load
(
f
)
vote_stat
=
json
.
load
(
f
)
else
:
else
:
vote_stat
=
defaultdict
(
list
)
vote_stat
=
defaultdict
(
list
)
...
...
opencompass/utils/summarizer.py
View file @
6e885d66
...
@@ -205,7 +205,7 @@ class Summarizer:
...
@@ -205,7 +205,7 @@ class Summarizer:
output_dir
=
osp
.
split
(
output_path
)[
0
]
output_dir
=
osp
.
split
(
output_path
)[
0
]
mmengine
.
mkdir_or_exist
(
output_dir
)
mmengine
.
mkdir_or_exist
(
output_dir
)
with
open
(
output_path
,
'w'
)
as
f
:
with
open
(
output_path
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
f
.
write
(
time_str
+
'
\n
'
)
f
.
write
(
time_str
+
'
\n
'
)
f
.
write
(
'tabulate format
\n
'
)
f
.
write
(
'tabulate format
\n
'
)
f
.
write
(
'^'
*
128
+
'
\n
'
)
f
.
write
(
'^'
*
128
+
'
\n
'
)
...
@@ -228,6 +228,6 @@ class Summarizer:
...
@@ -228,6 +228,6 @@ class Summarizer:
content
+=
f
'详细评测汇总已输出至
{
osp
.
abspath
(
output_path
)
}
'
content
+=
f
'详细评测汇总已输出至
{
osp
.
abspath
(
output_path
)
}
'
self
.
lark_reporter
.
post
(
content
)
self
.
lark_reporter
.
post
(
content
)
with
open
(
output_csv_path
,
'w'
)
as
f
:
with
open
(
output_csv_path
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
f
.
write
(
'
\n
'
.
join
([
','
.
join
(
row
)
for
row
in
table
])
+
'
\n
'
)
f
.
write
(
'
\n
'
.
join
([
','
.
join
(
row
)
for
row
in
table
])
+
'
\n
'
)
self
.
logger
.
info
(
f
'write csv to
{
osp
.
abspath
(
output_csv_path
)
}
'
)
self
.
logger
.
info
(
f
'write csv to
{
osp
.
abspath
(
output_csv_path
)
}
'
)
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