This file contains 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 the required modules | |
import sounddevice as sd # For accessing the microphone | |
import pynput # For sending keypresses | |
import numpy as np # For numerical calculations | |
import time as tm # For measuring time | |
# Define a function that checks the loudness of the sound input | |
def check_loudness(indata, outdata, frames, time, status): | |
global prev_state, last_trigger |
This file contains 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 trafilatura | |
import feedparser | |
import requests | |
from bs4 import BeautifulSoup | |
from feedgenerator import DefaultFeed, Enclosure | |
API_URL = "https://api-inference.huggingface.co/models/facebook/bart-large-cnn" | |
headers = {"Authorization": "Bearer HF_TOKEN"} |