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
#!/usr/bin/env python | |
# Copyright 2016 Google, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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 tika import parser # pip install tika | |
import os | |
FOLDER_WITH_PDF="./" | |
files = [f for f in os.listdir(FOLDER_WITH_PDF) if f.endswith('.pdf')] | |
for infile in files: | |
full_path = os.path.join(FOLDER_WITH_PDF, infile) | |
raw = parser.from_file(full_path) |
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
# Add a "QA" top and bottom bars to App Icons | |
# Using ImageMagick | |
#brew install imagemagick | |
######## | |
# Phone | |
######## | |
convert "App Icon 1024x1024.png" \ | |
-size 1024x128 -font "Times New Roman" -pointsize 96 -background 'rgb(106, 228, 222)' -fill red \ |
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 transformers import AutoTokenizer, AutoModelForCausalLM | |
#pip install tokenizers==0.10.3 transformers==4.8.0 | |
tokenizer = AutoTokenizer.from_pretrained("Norod78/distilgpt2-base-pretrained-he") | |
model = AutoModelForCausalLM.from_pretrained("Norod78/distilgpt2-base-pretrained-he", pad_token_id=tokenizer.eos_token_id) | |
prompt_text = "הנבחרת האולימפית של ישראל זכתה השנה" | |
max_len = 50 |
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.
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
# !pip install sentencepiece transformers tokenizers | |
from transformers import MarianTokenizer, MarianMTModel | |
from typing import List | |
import csv | |
src = "en" # source language | |
trg = "he" # target language |
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
#!/usr/bin/env xcrun swift | |
// $ chmod +x dalekTalk.swift | |
// $ ./dalekTalk.swift | |
// Based upon https://gist.github.com/okket/e461e85ea8b414863648 | |
import Cocoa | |
import AVFoundation | |
import Foundation |
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
# !pip install sentencepiece transformers tokenizers | |
from transformers import MarianTokenizer, MarianMTModel | |
from typing import List | |
src = "en" # source language | |
trg = "he" # target language | |
model_name = f"Helsinki-NLP/opus-mt-{src}-{trg}" |