Skip to content

Commit

Permalink
Update deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
icppWorld committed Mar 24, 2024
1 parent 4c9480b commit ee469e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions icpp_llama2/scripts/nft_mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Run with:
python -m scripts.nft_mint --network ic --canister <canister-name> --nft-config <path-to-your-nft-config-toml-file> --bitcoin-ordinal-ids <path-to-the-ordinal-ids-toml-file> # pylint: disable=line-too-long
python -m scripts.nft_mint --network ic --canister <canister-name> --nft-config <path-to-your-nft-config-toml-file> --token-ids <path-to-the-token-ids-toml-file> # pylint: disable=line-too-long
"""

# pylint: disable=invalid-name, too-few-public-methods, no-member, too-many-statements, broad-except
Expand Down Expand Up @@ -33,7 +33,7 @@ def main() -> int:
candid_path = ROOT_PATH / args.candid

nft_config_path = Path(args.nft_config)
bitcoin_ordinal_ids_path = Path(args.bitcoin_ordinal_ids)
token_ids_path = Path(args.token_ids)

dfx_json_path = ROOT_PATH / "dfx.json"

Expand All @@ -44,11 +44,11 @@ def main() -> int:
f"\n - dfx_json_path = {dfx_json_path}"
f"\n - candid_path = {candid_path}"
f"\n - nft_config_path = {nft_config_path}"
f"\n - bitcoin_ordinal_ids_path = {bitcoin_ordinal_ids_path}"
f"\n - token_ids_path = {token_ids_path}"
)

nft_config: Dict[Any, Any] = read_toml(nft_config_path)
bitcoin_ordinal_ids: Dict[Any, Any] = read_toml(bitcoin_ordinal_ids_path)
token_ids: Dict[Any, Any] = read_toml(token_ids_path)

# ---------------------------------------------------------------------------
# get ic-py based Canister instance
Expand Down Expand Up @@ -81,9 +81,9 @@ def main() -> int:
nft_id = nft_config["nft_id"]

NFT = {}
NFT["bitcoin_ordinal_id"] = bitcoin_ordinal_ids["bitcoin_ordinal_ids"][str(nft_id)]
NFT["token_id"] = token_ids["token_ids"][str(nft_id)]

print(f'--\nMinting NFT for bitcoin_ordinal_id = {NFT["bitcoin_ordinal_id"]}')
print(f'--\nMinting NFT for token_id = {NFT["token_id"]}')
error: bool = False
try:
response = canister_llama2.nft_mint(NFT)
Expand Down
12 changes: 6 additions & 6 deletions icpp_llama2/scripts/nft_update_story.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Run with:
python -m scripts.nft_update_story --network ic --canister <canister-name> --nft-config <path-to-your-nft-config-toml-file> --bitcoin-ordinal-ids <path-to-the-ordinal-ids-toml-file> # pylint: disable=line-too-long
python -m scripts.nft_update_story --network ic --canister <canister-name> --nft-config <path-to-your-nft-config-toml-file> --token-ids <path-to-the-token-ids-toml-file> # pylint: disable=line-too-long
"""

# pylint: disable=invalid-name, too-few-public-methods, no-member, too-many-statements, broad-except
Expand Down Expand Up @@ -33,7 +33,7 @@ def main() -> int:
candid_path = ROOT_PATH / args.candid

nft_config_path = Path(args.nft_config)
bitcoin_ordinal_ids_path = Path(args.bitcoin_ordinal_ids)
token_ids_path = Path(args.token_ids)

dfx_json_path = ROOT_PATH / "dfx.json"

Expand All @@ -44,11 +44,11 @@ def main() -> int:
f"\n - dfx_json_path = {dfx_json_path}"
f"\n - candid_path = {candid_path}"
f"\n - nft_config_path = {nft_config_path}"
f"\n - bitcoin_ordinal_ids_path = {bitcoin_ordinal_ids_path}"
f"\n - token_ids_path = {token_ids_path}"
)

nft_config: Dict[Any, Any] = read_toml(nft_config_path)
bitcoin_ordinal_ids: Dict[Any, Any] = read_toml(bitcoin_ordinal_ids_path)
token_ids: Dict[Any, Any] = read_toml(token_ids_path)

# ---------------------------------------------------------------------------
# get ic-py based Canister instance
Expand Down Expand Up @@ -80,12 +80,12 @@ def main() -> int:
nft_id = nft_config["nft_id"]

NFT = {}
NFT["bitcoin_ordinal_id"] = bitcoin_ordinal_ids["bitcoin_ordinal_ids"][str(nft_id)]
NFT["token_id"] = token_ids["token_ids"][str(nft_id)]

prompt = nft_config["prompt"]
print(
"--\nGenerating a story with:"
f"\n - bitcoin_ordinal_id = {NFT['bitcoin_ordinal_id']}"
f"\n - token_id = {NFT['token_id']}"
f"\n - prompt = {prompt['prompt']}"
f"\n - temperature = {prompt['temperature']}"
f"\n - topp = {prompt['topp']}"
Expand Down
2 changes: 1 addition & 1 deletion icpp_llama2/scripts/parse_args_nft_mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def parse_args() -> argparse.Namespace:
)

parser.add_argument(
"--bitcoin-ordinal-ids",
"--token-ids",
type=str,
default="no-default",
help="A toml file with all the bitcoin ordinal ids for the collection",
Expand Down

0 comments on commit ee469e2

Please sign in to comment.