Skip to content

Instantly share code, notes, and snippets.

@Norod
Norod / gpt2-run_generation-norod78-hebrew-gpt2-345m-il.ipynb
Last active Aug 5, 2020
מחולל שירים וסיפורים - מודל למידת מכונה - מבוסס ג'יפיטי2 - אומן ע"י דורון אדלר
View gpt2-run_generation-norod78-hebrew-gpt2-345m-il.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Norod
Norod / hebrew-GPT2-345M-il.sh
Created Aug 5, 2020
Setup huggingface transformers for generating Hebrew poetry text with GPU or CPU
View hebrew-GPT2-345M-il.sh
pip install git+https://github.com/huggingface/transformers
git clone https://github.com/huggingface/transformers
pip install -r "transformers/examples/requirements.txt"
python transformers/examples/text-generation/run_generation.py \
--model_type=gpt2 \
--model_name_or_path="Norod78/hebrew-GPT2-345M-il" \
--prompt="סוכריות קופצות" \
--num_return_sequences=5 \
--length=256 \
--stop_token="<|endoftext|>"
@Norod
Norod / stage.py
Last active Aug 2, 2020
Parse index.html files from the website stage.co.il
View stage.py
#Grab archived stories from stage.co.il using
#wayback_machine_downloader -c 8 -a http://stage.co.il/Stories
#
#This script, reads a "stage.co.il" index.html file and outputs the following HTML tag dirty text:
#Author name
#Title
#Story
#<|endoftext|>
@Norod
Norod / hewiki-articles-distilgpt2py-il.ipynb
Created Jul 22, 2020
hewiki-articles-distilGPT2py-il.ipynb
View hewiki-articles-distilgpt2py-il.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Norod
Norod / subxml2txt.py
Last active Jul 16, 2020
Read xml in OpenSubtitles format, output text intended for training machine learning models
View subxml2txt.py
#Read xml in OpenSubtitles format, output text intended for training machine learning models
import sys
from os import path
import time
import xml.etree.ElementTree as ET
if len(sys.argv) != 2:
print("Usage: "+ str(sys.argv[0]) + " input.xml")
exit(-1)
@Norod
Norod / immintrin.h
Created Mar 26, 2019
Workaround for "GNU-style inline assembly is disabled" error in Xcode 10.2 simulator for WatchOS 5.2 (See line 347)
View immintrin.h
/*===---- immintrin.h - Intel intrinsics -----------------------------------===
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
@Norod
Norod / UinstallXcode10_x.txt
Last active Jun 6, 2019
How to completely remove Xcode 10
View UinstallXcode10_x.txt
# How to completely remove Xcode 10
# Info taken from this thread: https://forums.developer.apple.com/thread/110227
# Keywords:
# Uninstall, Remove, Wipe, Delete, Xcode, Xcode 10
# Assuming everythig is installed in the default path
@Norod
Norod / tensorflow_r1.8_rc1_macOS_myBuildSettings.txt
Last active May 21, 2018
tensorflow_r1.8_rc1_macOS_patch.diff
View tensorflow_r1.8_rc1_macOS_myBuildSettings.txt
exports
-------
export CUDA_HOME=/usr/local/cuda
export DYLD_LIBRARY_PATH=/Users/dadler/lib:/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib
export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
export PATH=$DYLD_LIBRARY_PATH:$PATH
bazel
-----
I used bazel 0.10.0 (installed from bazel-0.10.0-installer-darwin-x86_64.sh)
@Norod
Norod / fbytlink_semi_auto_extract.sh
Last active Jun 23, 2019
How to extract a list of Youtube links from a Facebook discussion thread and generate a playlist
View fbytlink_semi_auto_extract.sh
@Norod
Norod / dalekTalk.swift
Last active Jul 11, 2016
A Dalek-like audio effect
View dalekTalk.swift
#!/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
You can’t perform that action at this time.