Skip to content

Instantly share code, notes, and snippets.

View sourangshupal's full-sized avatar
🎯
Focusing

Sourangshu Pal sourangshupal

🎯
Focusing
  • Bengaluru,India
View GitHub Profile
@sourangshupal
sourangshupal / lambda.py
Created May 10, 2025 13:47
AWS Sagemaker AI
import json
import boto3
ENDPOINT = "huggingface-pytorch-tgi-inference-"
sagemaker_runtime = boto3.client("sagemaker-runtime", region_name='us-east-1')
def lambda_handler(event, context):
query_params = event['queryStringParameters']
query = query_params['query']
@sourangshupal
sourangshupal / main.py
Created May 4, 2025 11:37
AWS BEDROCK DEMO
import json
import boto3
import botocore.config
from datetime import datetime
### AWS BEDROCK CALL ###
# {
# "modelId": "meta.llama4-scout-17b-instruct-v1:0",
@sourangshupal
sourangshupal / agents.yaml
Created April 8, 2025 08:39
GROQ with CREWAI Approach
content_writer:
role: >
Educational Content Writer
goal: >
Create engaging, informative content that thoroughly explains the assigned topic
and provides valuable insights to the reader
backstory: >
You are a talented educational writer with expertise in creating clear, engaging
content. You have a gift for explaining complex concepts in accessible language
and organizing information in a way that helps readers build their understanding.
# You can use mlflow context manager to log any param or metric values. One example is shown below
with mlflow.start_run():
mlflow.log_param("param_name", param_value)
mlflow.log_metric("metric_name", metric_value)
#Check the GPU
!nvidia-smi
#Check the packages installed
!pip freeze
#tensorflow-gpu package is by default installed in Colab
@sourangshupal
sourangshupal / detection_thread.py
Created June 5, 2020 07:52 — forked from mikaelhg/detection_thread.py
Minimal Tensorflow object detection example
import warnings
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=FutureWarning)
import h5py
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
import tensorflow as tf
# It is highly recommended to use Pandas for such data processing problems
import pandas as pd
import numpy as np
dataset = {'feature1': np.random.rand(5000),
'feature2': np.random.rand(5000),
'feature3': np.random.rand(5000)
}