Skip to content

Instantly share code, notes, and snippets.

absl-py==0.15.0
aiohttp==3.8.0
aiosignal==1.2.0
apex==0.1
async-timeout==4.0.0
attrs==21.2.0
certifi==2021.10.8
charset-normalizer==2.0.7
chex==0.0.8
click==8.0.3
@yellowback
yellowback / convert_marian_to_pytorch.py
Created August 12, 2021 07:29
modified version of convert_marian_to_pytorch.py for FuguMT conversion
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
{
"fp16": {
"enabled": "auto",
"loss_scale": 0,
"loss_scale_window": 1000,
"initial_scale_power": 16,
"hysteresis": 2,
"min_loss_scale": 1
},
import argparse
import pandas as pd
from datasets import load_metric
from transformers import AutoTokenizer
TOKENIZER_MODEL = 'cl-tohoku/bert-large-japanese'
def main(args):
df_ref = pd.read_csv(args.ref_file)
df_pred = pd.read_table(args.pred_file, names=['label'])
@yellowback
yellowback / mariadb-for-netbsd.patch
Last active April 3, 2018 09:40
mariadb patch for netbsd
--- mariadb-5.5.59/mysys/mysys_priv.h 2018-01-19 02:10:31.000000000 +0900
+++ mariadb-5.5.59/mysys/mysys_priv.h 2018-04-03 18:20:05.000000000 +0900
@@ -89,6 +89,7 @@
void my_error_unregister_all(void);
+#ifndef __NetBSD__
#ifndef O_PATH /* not Linux */
#if defined(O_SEARCH) /* Illumos */
#define O_PATH O_SEARCH
diff --git a/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php b/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php
index 8c9aac1..6460d01 100644
--- a/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php
+++ b/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php
@@ -54,7 +54,9 @@ class serendipity_event_bbcode extends serendipity_event
function bbcode_callback($matches) {
$type = $matches[1];
- $input = trim($matches[2], "\r\n");
+ $input = str_replace("<br />\r\n","foobarbaz123454321",$matches[2]);
diff --git a/lang/UTF-8/serendipity_lang_ja.inc.php b/lang/UTF-8/serendipity_lang_ja.inc.php
index 258005f..a5b8c3f 100644
--- a/lang/UTF-8/serendipity_lang_ja.inc.php
+++ b/lang/UTF-8/serendipity_lang_ja.inc.php
@@ -7,7 +7,7 @@
@define('LANG_CHARSET', 'UTF-8');
@define('SQL_CHARSET', 'utf8');
@define('DATE_LOCALES', 'ja_JP.UTF-8,ja,jp');
-@define('DATE_FORMAT_ENTRY', '%Y年 %B %e(%A)');
+@define('DATE_FORMAT_ENTRY', '%Y-%m-%d');
diff --git a/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php b/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php
index 37ceae6..532937b 100644
--- a/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php
+++ b/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php
@@ -152,8 +152,12 @@ class serendipity_event_nl2br extends serendipity_event
}
function restore($text) {
- global $_buf;
- return preg_replace('~\001(\d+)~e', '$_buf[$1]', $text);
#!/bin/sh
#
# $NetBSD: mysqld.sh,v 1.1.1.1 2011/04/25 21:12:15 adam Exp $
#
# PROVIDE: mysqld
# REQUIRE: DAEMON LOGIN mountall
# KEYWORD: shutdown
#
# You will need to set some variables in /etc/rc.conf to start MySQL:
#
Index: third_party/nspr/prcpucfg.h
===================================================================
--- third_party/nspr/prcpucfg.h (revision 161115)
+++ third_party/nspr/prcpucfg.h (working copy)
@@ -42,6 +42,8 @@
#include "base/third_party/nspr/prcpucfg_freebsd.h"
#elif defined(__OpenBSD__)
#include "base/third_party/nspr/prcpucfg_openbsd.h"
+#elif defined(__NetBSD__)
+#include "base/third_party/nspr/prcpucfg_openbsd.h"