Skip to content

Instantly share code, notes, and snippets.

View radomd92's full-sized avatar
🏠
Working from home

rado radomd92

🏠
Working from home
View GitHub Profile
from os import environ
from flask import Flask, jsonify, request
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pytorch_utils
app = Flask(__name__)
class Translator:
def __init__(self, model_name='nllb-200-distilled-1.3B'):
self._device = "cuda:0" if pytorch_utils.torch.cuda.is_available() else "cpu"
@radomd92
radomd92 / kvs_cache.py
Created September 10, 2020 00:06
simple KVS cache using dictionary. Adaptable for redis
from uuid import uuid4
class MyRedisAPI(object):
def __init__(self):
self.kvstore = {}
def set_identifier(self, class_):
self.identifier = class_.__name__ + str(uuid4())
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
#EXTINF:-1,BBC - Radio 2
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
#EXTINF:-1,BBC - Radio 4
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
#EXTINF:-1,BBC - Radio 5 live
@radomd92
radomd92 / ip_forward.md
Created July 29, 2020 18:23 — forked from tzermias/ip_forward.md
Forward traffic from wlan0 to eth0 interface

Forward traffic from a laptop's eth0 to wlan0

###To laptop

Specify an IP address to eth0 (here 192.168.56.1)

sudo ifconfig eth0 192.168.56.1 netmask 255.255.255.0
@radomd92
radomd92 / japan_radio_stations.xml
Last active February 5, 2024 11:52
Japanese Radio Stations
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<item>
<name>J-Pop Powerplay</name>
<location>Online</location>
<url>http://cabhs30.sonixcast.com:9628/;.mp3</url>
</item>
<item>
<name>Shonan Beach FM</name>
@radomd92
radomd92 / frwords.txt
Created May 12, 2020 18:00
Filter out French words
de
la
le
et
les
des
en
un
du
une