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
# /// script | |
# dependencies = [ | |
# "numpy", | |
# "torch", | |
# "kernels", | |
# ] | |
# /// | |
import torch | |
import torch.nn as nn |
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
# /// script | |
# dependencies = [ | |
# "numpy", | |
# "torch", | |
# "kernels", | |
# ] | |
# /// | |
import torch | |
# reuse the models from the previous snippets or copy the class |
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
# /// script | |
# dependencies = [ | |
# "numpy", | |
# "torch", | |
# "kernels", | |
# ] | |
# /// | |
import torch | |
import torch.nn as nn |
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
# /// script | |
# dependencies = [ | |
# "numpy", | |
# "torch", | |
# "kernels", | |
# ] | |
# /// | |
import torch | |
import torch.nn.functional as F |
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
# /// script | |
# dependencies = [ | |
# "numpy", | |
# "torch", | |
# "kernels", | |
# ] | |
# /// | |
import torch |
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
# /// script | |
# dependencies = [ | |
# "requests<3", | |
# ] | |
# /// | |
import requests | |
import concurrent.futures | |
import time | |
from datetime import datetime |
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
// Roku device IP address | |
const rokuIp = "192.168.1.252"; | |
// Base URL for ECP commands | |
const baseUrl = `http://${rokuIp}:8060/keypress`; | |
// Delay between commands in milliseconds | |
const delay = 3000; | |
async function sendKeypress(command) { | |
try { | |
const response = await fetch(`${baseUrl}/${command}`, { method: 'POST' }); |
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 collections import deque | |
import time | |
from dataclasses import dataclass | |
from typing import Deque, List, Dict | |
import requests | |
import os | |
class Colors: | |
PURPLE = "\033[95m" |
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 openai import OpenAI | |
ENDPOINT_URL = "ENDPOINT_URL" | |
HF_TOKEN = "YOUR_TOKEN" | |
# Initialize the client, pointing it to one of the available models | |
client = OpenAI( | |
base_url=ENDPOINT_URL + "/v1/", | |
api_key=HF_TOKEN, | |
) |
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
const SEND_IN_BLUE_KEY = "..." | |
const randomString = (length) => { | |
const bytes = new Uint8Array(length); | |
window.crypto.getRandomValues(bytes); | |
let result = ''; | |
bytes.forEach((b) => { | |
// Convert each byte to a digit (0-9) | |
result += (b % 10).toString(); | |
}); |
NewerOlder