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/env python | |
import os | |
import json | |
import time | |
import boto3 | |
import sagemaker | |
if __name__ == "__main__": |
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
root@8423ac911e05:/opt/tritonserver# tritonserver --model-repository=model_repository | |
I0425 10:08:43.682014 1236 pinned_memory_manager.cc:241] Pinned memory pool is created at '0x77fa88000000' with size 268435456 | |
I0425 10:08:43.682247 1236 cuda_memory_manager.cc:107] CUDA memory pool is created on device 0 with size 67108864 | |
I0425 10:08:43.684950 1236 model_lifecycle.cc:461] loading: detection_postprocessing:1 | |
W0425 10:08:43.685049 1236 model_lifecycle.cc:108] ignore version directory 'hf_cache' which fails to convert to integral number | |
I0425 10:08:43.685063 1236 model_lifecycle.cc:461] loading: sam_vit:1 | |
W0425 10:08:43.685125 1236 model_lifecycle.cc:108] ignore version directory 'hf_cache' which fails to convert to integral number | |
I0425 10:08:43.685138 1236 model_lifecycle.cc:461] loading: grounding_dino_tiny:1 | |
I0425 10:08:45.251843 1236 python_be.cc:2363] TRITONBACKEND_ModelInstanceInitialize: detection_postprocessing_0 (GPU device 0) | |
I0425 10:08:45.654267 1236 model_lifecycle.cc:818] successfully loaded 'd |
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 io | |
import numpy as np | |
import torch | |
from transformers import GroundingDinoForObjectDetection, GroundingDinoProcessor | |
import triton_python_backend_utils as pb_utils | |
from PIL import Image | |
class TritonPythonModel: |
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
package main | |
// Example of using MCP with Gemini via Function Calls | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"log" | |
"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
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"github.com/google/generative-ai-go/genai" | |
"github.com/hectormalot/omgo" |
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
from abc import ABC, abstractmethod | |
import re | |
from typing import Dict, Any | |
import json | |
import requests | |
from bs4 import BeautifulSoup | |
class Scraper(ABC): | |
def parse_site(self, url: str, headers: dict={}) -> Dict[str, Any]: |
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
#image processing resources | |
from skimage.io import imread, imshow | |
from skimage.filters import gaussian, threshold_otsu | |
from skimage.feature import canny | |
from skimage.transform import probabilistic_hough_line, rotate | |
#testing | |
import numpy as np | |
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
from urllib.parse import urlparse | |
from airflow.providers.amazon.aws.hooks.s3 import S3Hook | |
from airflow.providers.amazon.aws.operators.s3 import S3FileTransformOperator | |
def file_from_s3(prefix): | |
""" | |
Fetches S3 processed file from remote to local /tmp | |
to allow inference to run on it | |
""" |
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
from airflow.models.dag import DAG | |
from airflow.api.client.local_client import Client | |
from airflow.providers.amazon.aws.sensors.sqs import SqsSensor | |
def analyze_data(ti): | |
airflow_client = Client(None, None) | |
messages = ti.xcom_pull(task_ids="sqs_sensor", key="messages") | |
for msg in messages: | |
records = json.loads(msg['Body']) |
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
# Change these variables as necessary. | |
MAIN_PACKAGE_PATH := ./cmd/example | |
BINARY_NAME := example | |
# ==================================================================================== # | |
# HELPERS | |
# ==================================================================================== # | |
## help: print this help message | |
.PHONY: help |
NewerOlder