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
================================================================================================================================================================ | |
Layer (type (var_name)) Input Shape Output Shape Param # Kernel Shape | |
================================================================================================================================================================ | |
SdxlUNet2DConditionModel (SdxlUNet2DConditionModel) [1, 4, 128, 128] [1, 4, 128, 128] -- -- | |
├─Sequential (time_embed) [1, 320] [1, 1280] -- -- | |
│ └─Linear (0) [1, 320] [1, 1280] 410,880 -- | |
│ └─SiLU (1) [1, 1280] [1, 1280] -- |
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 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"} |
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
# implementation of Telegram site authorization checking algorithm | |
# for more information https://core.telegram.org/widgets/login#checking-authorization | |
import collections | |
import hmac | |
import hashlib | |
def check_string(d, token): | |
secret = hashlib.sha256() | |
secret.update(token.encode('utf-8')) |
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 spark.SparkContext | |
import SparkContext._ | |
/** | |
* A port of [[http://blog.echen.me/2012/02/09/movie-recommendations-and-more-via-mapreduce-and-scalding/]] | |
* to Spark. | |
* Uses movie ratings data from MovieLens 100k dataset found at [[http://www.grouplens.org/node/73]] | |
*/ | |
object MovieSimilarities { |
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |