-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixed most issues * finished persisting cache
- Loading branch information
Showing
7 changed files
with
143 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import os | ||
|
||
def search_ppkts(input_dir, raw_results_dir, lang_or_model): | ||
original_inputdir = f"{input_dir}/prompts/{lang_or_model}/" | ||
diff_dir = f"{raw_results_dir}/{lang_or_model}/differentials_by_file/" | ||
|
||
# files = os.ls(diff_dir) | ||
files = [] | ||
for (dirpath, dirnames, filenames) in os.walk(diff_dir): | ||
files.extend(filenames) | ||
break | ||
|
||
# if files not exist | ||
if files==[]: | ||
return original_inputdir | ||
else: | ||
selected_indir = original_inputdir + "tmp/" | ||
os.makedir(selected_indir) | ||
|
||
# prompts = os.ls(original_inputdir) | ||
promptfiles = [] | ||
for (dirpath, dirnames, filenames) in os.walk(original_inputdir): | ||
promptfiles.extend(filenames) | ||
break | ||
|
||
# foreach promptfile in original_inputdir | ||
for promptfile in promptfiles: | ||
aux = promptfile + ".result" | ||
if aux in files: | ||
continue | ||
else: | ||
os.copy(promptfile, selected_indir) | ||
return selected_indir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters