This file contains hidden or 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
import logging | |
import zipfile | |
import mimetypes | |
from io import BytesIO | |
from boto3 import resource | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
def upload_files(zipped, zipfile_info, destinationbucket, upload_path): |
This file contains hidden or 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
base) [ec2-user@ip-172-16-78-199 stable-diffusion-on-eks]$ kubectl logs sdruntime-sd-on-eks-sd-webui-inference-api-6cfbc85c7d-tbsng | |
Defaulted container "sd-webui-inference-api" out of: sd-webui-inference-api, sd-webui-queue-agent, xray-daemon | |
The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling `transformers.utils.move_cache()`. | |
Launching Web UI with arguments: -f --api --skip-prepare-environment --no-hashing --listen --port 8080 --xformers --ckpt v1-5-pruned-emaonly.safetensors --ckpt-dir /tmp/models/stable-diffusion --controlnet-dir /tmp/models/controlnet --lora-dir /tmp/models/lora --vae-dir /tmp/models/vae | |
Moving 0 files to the new cache system | |
0it [00:00, ?it/s] | |
Checkpoint in --ckpt argument not found (Possible it was moved to /opt/ml/code/models/Stable-diffusion: v1-5-pruned-emaonly.safetensors | |
2023-11-15 23:29:49,101 - ControlNet - INFO - ControlNet v1.1.410 | |
Co |
This file contains hidden or 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
#! /usr/bin/python3 | |
""" | |
extras.py: Upscale PNG images in DIR_IN into DIR_OUT. | |
Usage: Set API_URL, DIR_IN, and DIR_OUT. Then run ./extras.py | |
For API documentation see: http://localhost:7860/docs#/ | |
""" | |
import sys | |
import io | |
import os |
This file contains hidden or 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
# | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or 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
import json | |
import boto3 | |
client = boto3.client('rds') | |
def modify_acu(cluster_id, min_acu, max_acu): | |
resp = client.modify_db_cluster( | |
DBClusterIdentifier=cluster_id, | |
ApplyImmediately=True, | |
ServerlessV2ScalingConfiguration={ |
This file contains hidden or 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
import json | |
import sagemaker | |
import boto3 | |
from sagemaker.huggingface import HuggingFaceModel, get_huggingface_llm_image_uri | |
try: | |
role = sagemaker.get_execution_role() | |
except ValueError: | |
iam = boto3.client('iam') | |
role = iam.get_role(RoleName='sagemaker_execution_role')['Role']['Arn'] |
This file contains hidden or 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
import { Cluster } from "ioredis"; | |
const host = "clustercfg.test.xxxxxx.memorydb.ap-northeast-1.amazonaws.com"; | |
const port = 6379; | |
export const redis = new Cluster([{ host, port }], { | |
dnsLookup: (address, callback) => callback(null, address), | |
redisOptions: { | |
tls: {}, | |
}, |
This file contains hidden or 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
import sys | |
from opensearchpy import OpenSearch, helpers | |
host = 'vpc-xxxx-cyz5i7xdfs3dffsdgerwerw.ap-northeast-1.es.amazonaws.com' | |
port = 443 | |
auth = ('admin', 'password?') # For testing only. Don't store credentials in code. | |
# Create the client with SSL/TLS enabled, but hostname verification disabled. | |
client = OpenSearch( |
This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": "s3:*", | |
"Resource": "*" | |
}, | |
{ |
This file contains hidden or 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
import smtplib, ssl | |
port = 465 # For SSL | |
smtp_server = "smtp.gmail.com" | |
sender_email = "[email protected]" # Enter your address | |
receiver_email = "[email protected]" # Enter receiver address | |
password = input("Type your password and press enter: ") | |
message = """\ | |
Subject: Hi there |