Skip to content

Instantly share code, notes, and snippets.

View vamsiuppala's full-sized avatar

Vamsi Uppala vamsiuppala

View GitHub Profile
@vamsiuppala
vamsiuppala / use_pymsteams.md
Last active January 9, 2024 00:12
How to use pymsteams

Use Webhooks to send content to Microsoft Teams

pymsteams is an open source library to securely send content into a Teams Channel using webhooks. It's versatile, and can be combined with other libraries like tabulate to send dataframes as a connector card.

Example Code

import pymsteams
def get_current_and_previous_values():

    # write the code to fetch the two values from your upstream process
@vamsiuppala
vamsiuppala / README.md
Created January 7, 2024 18:58 — forked from veekaybee/README.md
whisper.ipynb

Using Whisper to transcribe audio

This episode of Recsperts was transcribed with Whisper from OpenAI, an open-source neural net trained on almost 700 hours of audio. The model includes an encoder-decoder architecture by tokenizing audio into 30-second chunks, normalizing audio samples to the log-Mel scale, and passing the data into an encoder. A decoder is trained to predict the captioned text matching the encoder, and the model includes transcription, as well as timestamp-aligned transcription, and multilingual translation.

Screen Shot 2023-01-29 at 11 09 57 PM

The transcription process outputs a single string file, so it's up to the end-user to parse out individual speakers, or run the model [through a sec

@vamsiuppala
vamsiuppala / README.md
Last active January 9, 2024 00:09
How to use Snowflake Shares when you know Share Name

Share data using Snowflake Shares

Secure Data Sharing lets you share selected objects in a database in your account with other Snowflake accounts. You can share the following Snowflake database objects:

  1. External tables
  2. Dynamic tables
  3. Secure views
  4. Secure materialized views
  5. Secure UDFs
  6. Tables

If you would like to get the structure of a folder as a .txt file, you could use the 'tree' library (install using pip).

For example, to get the structure of this folder:

image

Use this command while in the home of that particular folder in the terminal:

$ tree -a > folder-structure.txt
@vamsiuppala
vamsiuppala / normcore-llm.md
Created February 1, 2024 05:30 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@vamsiuppala
vamsiuppala / access_keys_in_colab_notebook.md
Last active February 16, 2024 19:56
How to access API keys securely in a Google Colab Notebook

Steps:

# Mount Google Drive to a Colab notebook
from google.colab import drive
drive.mount('/content/drive')

# Read and copy Key from the openai_api_key file
with open('/content/drive/My Drive/path_to_directory_containing_txt_file/openai_api_key.txt', 'r') as file:
    openai_api_key = file.read().strip()
 

When both Anaconda and Miniforge are installed

When both conda and miniforge are installed, depending on what PATH variable is set to, the command 'conda' refers to one of the two installations.

Screenshot 2024-02-19 at 9 19 40 PM

In this above case, the command to activate the environment 'ds' failed.

To avoid this, you can activate the 'ds' environment by being more clear about the source.

Remove special characters from string

import re

def replace_special_chars(text):
    # Define the pattern to match special characters and spaces
    pattern = r'[^a-zA-Z0-9]+'
    # Replace the matched pattern with underscores
 replaced_text = re.sub(pattern, '_', text)
@vamsiuppala
vamsiuppala / get_userfriendly_youtube_url.md
Last active March 16, 2024 05:28
Public User Friendly YouTube channel URL
@vamsiuppala
vamsiuppala / ssl_certification_error.md
Last active March 19, 2024 20:04
When you run into SSL certification error

Add this code when you run into SSL certification error

import ssl
ssl._create_default_https_context = ssl._create_unverified_context