-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VC models PyPi package #9
Open
mathfac
wants to merge
4
commits into
main
Choose a base branch
from
pypi_pkg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# @package hydra | ||
run: | ||
dir: /checkpoint/maksymets/vc/results/${hydra.job.name}/${oc.env:USER}/${WANDB.name} | ||
dir: /checkpoint/maksymets/eaif/results/${hydra.job.name}/${oc.env:USER}/${WANDB.name} | ||
subdir: ${hydra.job.num}_${hydra.job.override_dirname} | ||
sweep: | ||
dir: /checkpoint/maksymets/vc/results/${hydra.job.name}/${oc.env:USER}/${WANDB.name} | ||
dir: /checkpoint/maksymets/eaif/results/${hydra.job.name}/${oc.env:USER}/${WANDB.name} | ||
subdir: ${hydra.job.num}_${hydra.job.override_dirname} |
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 |
---|---|---|
|
@@ -99,7 +99,7 @@ def rollout_from_init_states( | |
# DMC test | ||
data_paths = pickle.load( | ||
open( | ||
"/checkpoint/maksymets/vc/datasets/dmc-expert-v0.1/dmc_reacher_easy-v1.pickle", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these paths hardcoded? |
||
"/checkpoint/maksymets/eaif/datasets/dmc-expert-v0.1/dmc_reacher_easy-v1.pickle", | ||
"rb", | ||
) | ||
) | ||
|
@@ -129,7 +129,7 @@ def rollout_from_init_states( | |
# Adroit test | ||
data_paths = pickle.load( | ||
open( | ||
"/checkpoint/maksymets/vc/datasets/adroit-expert-v0.1/pen-v0.pickle", "rb" | ||
"/checkpoint/maksymets/eaif/datasets/adroit-expert-v0.1/pen-v0.pickle", "rb" | ||
) | ||
) | ||
e = env_constructor( | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,6 @@ run: | |
dir: ./outputs/${hydra.job.name}/${now:%Y-%m-%d}_${now:%H-%M-%S} | ||
subdir: ${hydra.job.num}_${hydra.job.override_dirname} | ||
sweep: | ||
dir: /checkpoint/maksymets/vc/results/${hydra.job.name}/${oc.env:USER}/${now:%Y-%m-%d}_${now:%H-%M-%S} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use local paths |
||
dir: /checkpoint/maksymets/eaif/results/${hydra.job.name}/${oc.env:USER}/${now:%Y-%m-%d}_${now:%H-%M-%S} | ||
subdir: ${hydra.job.num}_${hydra.job.override_dirname} | ||
|
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,6 @@ | ||
torch >= 1.10.2 | ||
torchvision >= 0.11.3 | ||
timm==0.6.11 | ||
hydra-core | ||
wandb>=0.13 | ||
requests |
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,91 @@ | ||
#!/bin/bash | ||
|
||
# Check if the script is being run from the correct directory | ||
if [ ! -f "setup.py" ]; then | ||
echo "Error: This script should be run from the directory containing the 'setup.py' file." | ||
echo "Please navigate to the correct directory and run the script as follows:" | ||
echo " ./scripts/build_pkg.sh" | ||
exit 1 | ||
fi | ||
|
||
|
||
# Function to check if a Python package is installed | ||
python_package_exists() { | ||
python -c "import pkgutil; exit(0 if pkgutil.find_loader('$1') else 1)" &> /dev/null | ||
} | ||
|
||
# Check for Python package dependencies | ||
dependencies=("twine" "wheel" "setuptools") | ||
missing_dependencies=() | ||
|
||
for dep in "${dependencies[@]}"; do | ||
if ! python_package_exists "$dep"; then | ||
missing_dependencies+=("$dep") | ||
fi | ||
done | ||
|
||
if [ ${#missing_dependencies[@]} -ne 0 ]; then | ||
echo "The following Python package dependencies are missing: ${missing_dependencies[*]}" | ||
echo "Please install them using the following command:" | ||
echo " pip install ${missing_dependencies[*]}" | ||
exit 1 | ||
fi | ||
|
||
# Function to prompt the user for confirmation | ||
confirm() { | ||
read -p "$1 (y/n): " choice | ||
case "$choice" in | ||
y|Y ) return 0;; | ||
n|N ) return 1;; | ||
* ) echo "Invalid input. Please enter 'y' or 'n'."; confirm "$1";; | ||
esac | ||
} | ||
|
||
# Clean build artifacts | ||
if confirm "Do you want to clean previous build artifacts?"; then | ||
rm -rf build dist *.egg-info | ||
echo "Cleaned previous build artifacts." | ||
fi | ||
|
||
# Run tests (replace `python -m unittest` with your test command if different) | ||
if confirm "Do you want to run tests?"; then | ||
python -m unittest | ||
if [ $? -ne 0 ]; then | ||
echo "Tests failed. Please fix the issues before building and uploading the package." | ||
exit 1 | ||
else | ||
echo "All tests passed." | ||
fi | ||
fi | ||
|
||
# Build the package | ||
if confirm "Do you want to build the package?"; then | ||
python setup.py sdist bdist_wheel | ||
echo "Package built successfully." | ||
if [ $? -eq 0 ]; then | ||
echo "Package built successfully." | ||
else | ||
echo "Failed to built successfully." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Upload to TestPyPI | ||
if confirm "Do you want to upload the package to TestPyPI?"; then | ||
twine upload --repository-url https://test.pypi.org/legacy/ dist/* | ||
if [ $? -eq 0 ]; then | ||
echo "Package uploaded to TestPyPI." | ||
else | ||
echo "Failed to upload the package to TestPyPI." | ||
fi | ||
fi | ||
|
||
# Upload to PyPI | ||
if confirm "Do you want to upload the package to PyPI?"; then | ||
twine upload dist/* | ||
if [ $? -eq 0 ]; then | ||
echo "Package uploaded to PyPI." | ||
else | ||
echo "Failed to upload the package to PyPI." | ||
fi | ||
fi |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These paths should not be here?