Skip to content

Instantly share code, notes, and snippets.

View veer66's full-sized avatar

Vee Satayamas veer66

View GitHub Profile
(setq elfeed-feeds
'("http://feeds.feedburner.com/bact"
"https://kitty.in.th/index.php/feed/"
"https://www.unzeen.com/feed/"
"https://dev.to/feed/mrchoke"
"https://dev.to/feed/iporsut"
"http://thep.blogspot.com/feeds/posts/default"
"https://naiwaen.debuggingsoft.com/feed/"
"https://www.blognone.com/taxonomy/term/10564/feed"
"https://www.blognone.com/taxonomy/term/5345/feed"))
import time
from pygame import mixer
from pygame.mixer import music
import socket
import ssl
import uuid
import json
MIN_XTZ = 4.7

Benchmark

nlpo3-cli vs newmm

Setup

  • Computer: Scaleway's Mac mini M1
  • Rustc: rustc 1.54.0 (a178d0322 2021-07-26)
  • Python: Python 3.8.2
  • OS: Darwin 506124d8-4acf-4595-9d46-8ca4b44b8110 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 arm64
;; How to run
;; sbcl --load download-peertube-videos.lisp
(ql:quickload :jonathan)
(ql:quickload :dexador)
(ql:quickload :alexandria)
(ql:quickload :asdf)
(import 'alexandria:assoc-value)
import torch
from attacut import Tokenizer
tok = Tokenizer()
txt = "กาก้ากูกู้"
tokens, features = tok.dataset.make_feature(txt)
inputs = (features, torch.Tensor(0))
x, _, _ = tok.dataset.prepare_model_inputs(inputs)
m = torch.jit.trace(tok.model, (x,))
m.save("attacut-sc.pt")
from transformers import GPT2Tokenizer, GPTNeoForCausalLM
tokenizer = GPT2Tokenizer.from_pretrained("wannaphong/thaigpt-next-125m")
model = GPTNeoForCausalLM.from_pretrained("wannaphong/thaigpt-next-125m")
inputs = tokenizer("<|startoftext|>พระทรงสารศรีเศวตเกศกุญชร", return_tensors="pt")
outputs = model(**inputs, labels=inputs["input_ids"])
print(outputs.loss)
use tch::nn::Module;
use tch::nn::OptimizerConfig;
use tch::nn::RNN;
use tch::Reduction;
use tch::{nn, Device, Tensor};
use std::fs::File;
use std::io::BufWriter;
use std::io::Write;
const SYN_LEN: usize = 100000;
defmodule Rename64 do
@moduledoc """
Documentation for `Rename64`.
"""
# def extract_q(name_list_path) do
# name_list_path
# |> Path.basename
# |> (fn p -> Regex.named_captures(~r/Namelist_(?<q>Q\d+)\.txt/, p) end).()
# |> (fn m -> m["q"] end).()
(defpackage #:cl-wordcut
(:use #:cl)
(:import-from #:str :join))
(in-package #:cl-wordcut)
(declaim (optimize (speed 3) (debug 0) (safety 0)))
(defconstant +default-dix-ptr-size+ 1024)
(defstruct node-key
(ql:quickload 'str)
(defpackage #:cl-wordcut
(:use #:cl)
(:import-from #:str :join))
(in-package #:cl-wordcut)
(declaim (optimize (speed 3) (debug 0) (safety 0)))
(defconstant +default-dix-ptr-size+ 1024)