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
from timeit import default_timer as timer | |
class SimpleProfiler: | |
"""Class to test times over multiple named checkpoints. | |
Usage: | |
# Starts timer | |
p = SimpleProfiler() |
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 pickle | |
from pathlib import Path | |
import tensorflow as tf | |
root = Path('./PetImages') | |
num_skipped = 0 | |
examples = [] | |
for folder_name in ("Cat", "Dog"): | |
for fpath in (root / folder_name).glob('*'): |
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 pickle | |
from pathlib import Path | |
import tensorflow as tf | |
root = Path('./PetImages') | |
num_skipped = 0 | |
examples = [] | |
for folder_name in ("Cat", "Dog"): | |
for fpath in (root / folder_name).glob('*'): |
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
function TRANSLATE(text, repo_id="Helsinki-NLP/opus-mt-en-es") { | |
endpoint = "https://api-inference.huggingface.co/pipeline/translation/" + repo_id; | |
const payload = JSON.stringify({ | |
"inputs": text | |
}); | |
// Add your token from https://huggingface.co/settings/token | |
const options = { | |
"headers": {"Authorization": "Bearer <YOUR HUGGINGFACE API KEY>"}, | |
"wait_for_model": true, |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer