Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 boto3 | |
import json | |
from typing import Dict, List, Optional | |
import re | |
def get_detailed_s3_uris( | |
knowledge_base_id: str, | |
data_source_id: str | |
) -> Dict: | |
""" |
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 os | |
import shutil | |
import concurrent.futures | |
import boto3 | |
from pathlib import Path | |
import logging | |
import time | |
def move_folders_to_combined(bucket_name, folders_to_move=["SSE", "FPA", "Hypershield"], log_level=logging.INFO): | |
""" |
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 qrcode | |
import logging | |
import re | |
import os | |
# Install the following package before running the script: pip install qrcode | |
# set a logger | |
logging.basicConfig( | |
format='[%(asctime)s] p%(process)s {%(filename)s:%(lineno)d} %(levelname)s - %(message)s', |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 os | |
import csv | |
import logging | |
import requests | |
from datetime import datetime | |
from typing import Optional, List | |
logging.basicConfig(format='[%(asctime)s] p%(process)s {%(filename)s:%(lineno)d} %(levelname)s - %(message)s', level=logging.INFO) | |
logger = logging.getLogger(__name__) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Human: you are a metadata tagger, see the following schema and tag the data that follows to extract the metadata fields listed in the schema: | |
<schema> | |
schema = { | |
"properties": { | |
"movie_title": { "type": "string" }, | |
"critic": { "type": "string" }, | |
"tone": { | |
"type": "string", | |
"enum": ["positive", "negative"] |
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
""" | |
Get information about models in Amazon SageMaker JumpStart. | |
Tested with sagemaker SDK version 2.203.0. | |
""" | |
## View the full list of models available through JumpStart here: https://sagemaker.readthedocs.io/en/stable/doc_utils/pretrainedmodels.html | |
import pandas as pd | |
from typing import Dict, List | |
from sagemaker import get_execution_role |
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 botocore.session | |
import requests as req | |
from botocore.auth import SigV4Auth | |
from botocore.awsrequest import AWSRequest | |
# Configuration and payload | |
region = "us-east-1" | |
model_id = 'cohere.command-text-v14' | |
endpoint = f"https://bedrock-runtime.{region}.amazonaws.com/model/{model_id}/invoke" |
NewerOlder