Skip to content

Commit

Permalink
Merge pull request #1 from timechess/main
Browse files Browse the repository at this point in the history
Use poetry and Nix
  • Loading branch information
CIntellifusion authored Jun 6, 2024
2 parents 604357b + b842af5 commit f74fe6c
Show file tree
Hide file tree
Showing 9 changed files with 2,677 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/LatentDiffusion/data/__pycache__
**/__pycache__
*.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in { devShells.default = import ./shell.nix { inherit pkgs system; }; });
}
2,555 changes: 2,555 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[tool.poetry]
name = "simplediffusion"
version = "0.1.0"
description = ""
#authors = ["Your Name <[email protected]>"]
license = "MIT"
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = ">=3.9,<3.13"
pytorch-lightning = "^1.8.3"
torchmetrics = "^0.11.4"
datasets = "^2.18.0"
transformers = "4.30.2"
diffusers = "^0.20.0"
torch = { version = "2.0.1", source="torch"}
torchvision = { version = "0.15.2", source="torch"}
opencv-python = "^4.9.0.80"
tensorboard = "^2.16.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[[tool.poetry.source]]
name = "torch"
url = "https://download.pytorch.org/whl/cu118/"
priority = "supplemental"


[[tool.poetry.source]]
name = "mirrors"
url = "https://pypi.tuna.tsinghua.edu.cn/simple/"
priority = "primary"
14 changes: 14 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ pkgs, ... }:

(pkgs.mkShell rec {

buildInputs = (with pkgs; [ python39 poetry gcc gnumake zsh zlib libGL glib]);

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc];

shellHook = ''
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath buildInputs}:$LD_LIBRARY_PATH"
poetry env use ${pkgs.python39}/bin/python
poetry install
'';
})

0 comments on commit f74fe6c

Please sign in to comment.