fix some multi_apps tasks
This commit is contained in:
@@ -86,6 +86,7 @@ def compare_docx_files(file1, file2, **options):
|
|||||||
ignore_case = options.get('ignore_case', False)
|
ignore_case = options.get('ignore_case', False)
|
||||||
ignore_order = options.get('ignore_order', False)
|
ignore_order = options.get('ignore_order', False)
|
||||||
content_only = options.get('content_only', False)
|
content_only = options.get('content_only', False)
|
||||||
|
delete_empty_lines = options.get('delete_empty_lines', False)
|
||||||
|
|
||||||
if not file1 or not file2:
|
if not file1 or not file2:
|
||||||
return 0
|
return 0
|
||||||
@@ -119,6 +120,9 @@ def compare_docx_files(file1, file2, **options):
|
|||||||
if ignore_order:
|
if ignore_order:
|
||||||
doc1_paragraphs = sorted(doc1_paragraphs)
|
doc1_paragraphs = sorted(doc1_paragraphs)
|
||||||
doc2_paragraphs = sorted(doc2_paragraphs)
|
doc2_paragraphs = sorted(doc2_paragraphs)
|
||||||
|
if delete_empty_lines:
|
||||||
|
doc1_paragraphs = [p for p in doc1_paragraphs if p.strip()]
|
||||||
|
doc2_paragraphs = [p for p in doc2_paragraphs if p.strip()]
|
||||||
elif file1.endswith('.odt') and file2.endswith('.odt'):
|
elif file1.endswith('.odt') and file2.endswith('.odt'):
|
||||||
try:
|
try:
|
||||||
doc1 = load(file1)
|
doc1 = load(file1)
|
||||||
@@ -131,6 +135,9 @@ def compare_docx_files(file1, file2, **options):
|
|||||||
if ignore_order:
|
if ignore_order:
|
||||||
doc1_paragraphs = sorted(doc1_paragraphs)
|
doc1_paragraphs = sorted(doc1_paragraphs)
|
||||||
doc2_paragraphs = sorted(doc2_paragraphs)
|
doc2_paragraphs = sorted(doc2_paragraphs)
|
||||||
|
if delete_empty_lines:
|
||||||
|
doc1_paragraphs = [p for p in doc1_paragraphs if p.strip()]
|
||||||
|
doc2_paragraphs = [p for p in doc2_paragraphs if p.strip()]
|
||||||
else:
|
else:
|
||||||
# Unsupported file types or mismatch
|
# Unsupported file types or mismatch
|
||||||
print("Unsupported file types or mismatch between file types.")
|
print("Unsupported file types or mismatch between file types.")
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
{
|
{
|
||||||
"type": "launch",
|
"type": "launch",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"command": "VLC_VERBOSE=-1 vlc --aout=dummy --repeat '/home/user/Desktop/planet.mp4'",
|
"command": "vlc",
|
||||||
"shell": true
|
"shell": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,13 @@
|
|||||||
"command": "echo password | sudo -S pip install pysrt",
|
"command": "echo password | sudo -S pip install pysrt",
|
||||||
"shell": "true"
|
"shell": "true"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"parameters": {
|
||||||
|
"command": "echo osworld-public-evaluation | sudo -S pip install pysrt",
|
||||||
|
"shell": "true"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"func": "exact_match",
|
"func": "exact_match",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "a82b78bb-7fde-4cb3-94a4-035baf10bcf0",
|
"id": "a82b78bb-7fde-4cb3-94a4-035baf10bcf0",
|
||||||
"snapshot": "libreoffice_calc",
|
"snapshot": "libreoffice_calc",
|
||||||
"instruction": "I'm really enjoying this paper. Could you please locate the personal webpages of the initial author and the last three authors? Please include them in a browser bookmark folder titled 'Liked Authors.'",
|
"instruction": "I'm really enjoying this paper. Could you please locate the personal webpages of the initial author and the last three authors? Please include them in a browser bookmark folder titled 'Liked Authors' under the 'Bookmarks bar'.",
|
||||||
"source": "authors",
|
"source": "authors",
|
||||||
"config": [
|
"config": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
},
|
},
|
||||||
"expected": {
|
"expected": {
|
||||||
"type": "cloud_file",
|
"type": "cloud_file",
|
||||||
"path": "https://huggingface.co/datasets/xlangai/ubuntu_osworld_file_cache/resolve/main/multi_apps/b5062e3e-641c-4e3a-907b-ac864d2e7652/authors-gt.xlsx",
|
"path": "https://huggingface.co/datasets/xlangai/ubuntu_osworld_file_cache/resolve/main/multi_apps/b5062e3e-641c-4e3a-907b-ac864d2e7652/authors-ground_truth.xlsx",
|
||||||
"dest": "authors-gt.xlsx"
|
"dest": "authors-gt.xlsx"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
|
|||||||
@@ -55,6 +55,12 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"func": "compare_docx_files",
|
"func": "compare_docx_files",
|
||||||
|
"options": {
|
||||||
|
"ignore_blanks": true,
|
||||||
|
"ignore_order": true,
|
||||||
|
"content_only": true,
|
||||||
|
"delete_empty_lines": true
|
||||||
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"type": "vm_file",
|
"type": "vm_file",
|
||||||
"path": "/home/user/Desktop/script.docx",
|
"path": "/home/user/Desktop/script.docx",
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
{
|
{
|
||||||
"host": "gw.dataimpulse.com",
|
"host": "gw.dataimpulse.com",
|
||||||
"port": 823,
|
"port": 823,
|
||||||
"username": "67e5faf31654b923f06b",
|
"username": "e750e5abb74376d28361",
|
||||||
"password": "26a3158d346abdfa",
|
"password": "e5ec245537e1e76a",
|
||||||
"protocol": "http",
|
"protocol": "http",
|
||||||
"provider": "dataimpulse",
|
"provider": "dataimpulse",
|
||||||
"type": "residential",
|
"type": "residential",
|
||||||
|
|||||||
Reference in New Issue
Block a user