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 getpass | |
import os | |
if not os.environ.get("OPENAI_API_KEY"): | |
os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ") | |
if not os.environ.get("GOOGLE_API_KEY"): | |
os.environ["GOOGLE_API_KEY"] = getpass.getpass("Enter API key for Google Gemini: ") | |
from langchain.chat_models import init_chat_model |
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 getpass | |
import os | |
if not os.environ.get("OPENAI_API_KEY"): | |
os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ") | |
if not os.environ.get("GOOGLE_API_KEY"): | |
os.environ["GOOGLE_API_KEY"] = getpass.getpass("Enter API key for Google Gemini: ") | |
from langchain.chat_models import init_chat_model |
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 python3 | |
""" | |
Record mic audio → 2s Whisper-ready chunks (file_1.wav, file_2.wav, ...), | |
optimized to avoid input overflows. | |
Requires: pip install sounddevice | |
""" | |
import argparse | |
import sys |
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
# The code is from Srijith Rajmohan website and it is present on this link https://srijithr.gitlab.io/post/pytorchdist/ | |
from __future__ import print_function | |
import argparse | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
from torchvision import datasets, transforms | |
from torch.optim.lr_scheduler import StepLR |