Skip to content

Instantly share code, notes, and snippets.

View Mihonarium's full-sized avatar

Mikhail Samin Mihonarium

View GitHub Profile
@Mihonarium
Mihonarium / reverse-information-retrieval.ipynb
Last active October 6, 2023 20:40
Transformers can do reverse information retrieval (public).ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package main
import (
"crypto/sha256"
"encoding/hex"
"fmt"
"log"
"sync"
)
from tqdm import tqdm
def top_1_acc(OV_circuit):
return ((OV_circuit.argmax(dim=0) == t.arange(0, OV_circuit.size(-1)).to(device)).sum() / OV_circuit.size(-1)).item()
def top_5_acc(OV_circuit):
return ((OV_circuit.topk(5, dim=0)[1] == t.arange(0, OV_circuit.size(-1)).to(device)).sum() / OV_circuit.size(-1)).item()
W_U = model.unembed.W_U.to(device)
W_E = model.embed.W_E.to(device)
@Mihonarium
Mihonarium / docx_replacer.go
Created March 5, 2022 13:08
A find-and-replace in multiple .docx files, most of the code is generated by Copilot
package main
import (
"fmt"
"github.com/nguyenthenguyen/docx"
"net/http"
"os"
"strings"
)
@Mihonarium
Mihonarium / EvilPermutationCheck.go
Last active August 9, 2021 22:19
An evil and time-based way to check whether an array is permutation, as an answer to https://t.me/oleg_log/4809
package main
import (
"fmt"
"sync"
"time"
)
type BetterObject struct {
ID int
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am mihonarium on github.
  • I am mihonarium (https://keybase.io/mihonarium) on keybase.
  • I have a public key ASDS_NKvBMDYetF7UgN430JNqUYoDWHMEAtEGzxSmVg2NQo

To claim this, I am signing this object:

<?php
include 'bot_functions.php';
function downloadAudioFile($audiolink)
{
$ext = 'mp3';
$saveFile = 'tmp/'.md5(microtime(true)).'.'.$ext;
file_put_contents("$saveFile", fopen("$audiolink", 'r'));
return $saveFile;
<?php
function echo_ok() {
ob_start();
echo 'ok';
$length = ob_get_length();
header('Connection: close');
header("Content-Length: " . $length);
header("Content-Encoding: none");
<?php
include('include/bot_fs.php');
include('include/vk_fs.php');
$confirmation_token = '/* скрыто */';
$token = '/* скрыто */';
$data = json_decode(file_get_contents('php://input'));
$group_id = $data->group_id;