Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# This is a modified version of TRL's `SFTTrainer` example (https://github.com/huggingface/trl/blob/main/examples/scripts/sft_trainer.py), | |
# adapted to run with DeepSpeed ZeRO-3 and Mistral-7B-V1.0. The settings below were run on 1 node of 8 x A100 (80GB) GPUs. | |
# | |
# Usage: | |
# - Install the latest transformers & accelerate versions: `pip install -U transformers accelerate` | |
# - Install deepspeed: `pip install deepspeed==0.9.5` | |
# - Install TRL from main: pip install git+https://github.com/huggingface/trl.git | |
# - Clone the repo: git clone github.com/huggingface/trl.git | |
# - Copy this Gist into trl/examples/scripts | |
# - Run from root of trl repo with: accelerate launch --config_file=examples/accelerate_configs/deepspeed_zero3.yaml --gradient_accumulation_steps 8 examples/scripts/sft_trainer.py |
#!perl -w | |
=head1 NAME | |
pl2py.pl | |
=head1 DESCRIPTION | |
Attempts to convert perl scripts to python with the awesome power of regular expressions. |
name: Minimal Android CI Workflow | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*' | |
jobs: |
# We start by loading up PyICU. | |
import PyICU as icu | |
# Let's create a test text. Notice it contains some punctuation. | |
test = u"This is (\"a\") test!" | |
# We create a wordbreak iterator. All break iterators in ICU are really RuleBasedBreakIterators, and we need to tell it which locale to take the word break rules from. Most locales have the same rules for UAX#29 so we will use English. | |
wb = icu.BreakIterator.createWordInstance(icu.Locale.getEnglish()) | |
# An iterator is just that. It contains state and then we iterate over it. The state in this case is the text we want to break. So we set that. |
import random | |
class TicTacToe: | |
def __init__(self, playerX, playerO): | |
self.board = [' ']*9 | |
self.playerX, self.playerO = playerX, playerO | |
self.playerX_turn = random.choice([True, False]) | |
def play_game(self): |
import os.path | |
import collections | |
from operator import itemgetter | |
WORDFILE = '/usr/share/dict/words' | |
class Autocorrect(object): | |
""" | |
Very simplistic implementation of autocorrect using ngrams. | |
""" |
""" | |
Functions for converting dates to/from JD and MJD. Assumes dates are historical | |
dates, including the transition from the Julian calendar to the Gregorian | |
calendar in 1582. No support for proleptic Gregorian/Julian calendars. | |
:Author: Matt Davis | |
:Website: http://github.com/jiffyclub | |
""" |
<?xml version='1.0' encoding='UTF-8'?> | |
<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0"> | |
<rootfiles> | |
<rootfile media-type="application/oebps-package+xml" full-path="content.opf"/> | |
</rootfiles> | |
</container> |