[-] holdengreen@lemmygrad.ml 7 points 2 years ago

hope I don't get in trouble for this

1

I look endlessly for parts on alibaba, rn for solar batteries. And I have tried to ship for parts like cooling fans but then I am bitten by shipping at the end....

Now I find myself having to inquire about each part because the prices listed aren't accurate.

How to get what I need?

1

Cat climbed up on the counter and tried to mess em up.

I want to start an indoor and outdoor garden. Planting season is coming up.

I'm also having decent success germinating some rice.

I'm somewhat regretting my choice to buy pinto and black bean 'seeds'.

Also I've been making trips up into the hills to dig up naturally occurring clay and that sort of thing and carry it down in my big backpack.

Maybe I can try and make some dirt out of that.... I already went to home depot to get some garden fertilizer, but I prob need to get some high nitrogen stuff in bulk.

1
submitted 2 years ago* (last edited 2 years ago) by holdengreen@lemmygrad.ml to c/learnspanish@lemmygrad.ml

I thought to do this when I started reading the pinned post titled 'Listening-Reading Method and Spanish'.

https://farkastranslations.com/bilingual_books.php

I encoded it in 112kbps opus to an ogg file using ffmpeg (it's mono, ~731MB, 15:12:58 long): https://github.com/holdengreen/lingtool/blob/main/streams/center-earth-journey-es-en-original-botched.ogg

I wrote the script to process the text file at: https://farkastranslations.com/books/Verne_Jules-Voyage_au_Centre_de_la_Terre-fr-en-es-hu-nl.zip

Here is the script (https://github.com/holdengreen/lingtool/blob/main/src/center-earth-parallel.py):

import re
import sys
import torch

import numpy as np
MAX_WAV_VALUE = 32768.0

sample_rate = 48000

accelerator = 'cpu'
device = torch.device(accelerator)

class SpanishTTS:
    language = 'es'
    model_id = 'v3_es'
    speaker = 'es_1'

    def __init__(self):
        self.model, example_text = torch.hub.load(repo_or_dir='snakers4/silero-models',
                                                model='silero_tts',
                                                language=self.language,
                                                speaker=self.model_id)

        self.model.to(device)  # gpu or cpu

    def apply(self, text):
        return self.model.apply_tts(text=text,
                        speaker=self.speaker,
                        sample_rate=sample_rate) * MAX_WAV_VALUE


class EnglishTTS:
    language = 'en'
    model_id = 'v3_en'
    speaker = 'en_117'

    def __init__(self):
        self.model, example_text = torch.hub.load(repo_or_dir='snakers4/silero-models',
                                                model='silero_tts',
                                                language=self.language,
                                                speaker=self.model_id)

        self.model.to(device)  # gpu or cpu

    def apply(self, text):
        return self.model.apply_tts(text=text,
                        speaker=self.speaker,
                        sample_rate=sample_rate) * MAX_WAV_VALUE


spanishtts = SpanishTTS()
englishtts = EnglishTTS()


FFMPEG_BIN = "ffmpeg"

import subprocess as sp
from fcntl import fcntl, F_GETFL, F_SETFL
from os import O_NONBLOCK, read



fl = open("res/foreign/parallel-translations/Verne_Jules-Voyage_au_Centre_de_la_Terre-fr-en-es-hu-nl.farkastranslations.com/Verne_Jules-Voyage_au_Centre_de_la_Terre-fr-en-es-hu-nl.txt", 'r')
t = fl.read()
fl.close()


errfl = open("log/err.txt", 'a+')

proc = sp.Popen([ FFMPEG_BIN,
       '-y', # (optional) means overwrite the output file if it already exists.
       "-f", 's16le', # means 16bit input
       "-acodec", "pcm_s16le", # means raw 16bit input
       '-ar', str(sample_rate), # the input will have 48000 Hz
       '-ac','1', # the input will have 2 channels (stereo)
       '-i', 'pipe:0', # means that the input will arrive from the pipe
       '-vn', # means "don't expect any video input"
       '-acodec', "libopus", # output audio codec
       '-b:a', "112k", # output bitrate (=quality).
       'streams/center-earth-journey-es-en-1.ogg',
       '-loglevel', 'debug'
       ],
        stdin=sp.PIPE,stdout=errfl, stderr=errfl, shell=False)


#flags = fcntl(proc.stdout, F_GETFL) # get current p.stdout flags
#fcntl(proc.stdout, F_SETFL, flags | O_NONBLOCK)


def readlines():
    #print(proc.stdout.readlines())

    #while True:
    while False:
        try:
            print(read(proc.stdout.fileno(), 1024))
        except OSError:
            # the os throws an exception if there is no data
            print('[No more data]')
            break

#print(ascii(t))

t = t.split('\n')

max_ln = len(t)
ln_cnt = 1
for e in t:
    print("processing {0}/{1}".format(str(ln_cnt), str(max_ln)))

    g = re.split(r'\t+', e)

    try:

        #spanish
        proc.stdin.write(np.asarray(spanishtts.apply(g[2]), dtype=np.int16).tobytes())

        #1 second pause
        proc.stdin.write(np.asarray([0] * sample_rate, dtype=np.int16).tobytes())


        # english
        proc.stdin.write(np.asarray(englishtts.apply(g[1]), dtype=np.int16).tobytes())

        #2 second pause
        proc.stdin.write(np.asarray([0] * (sample_rate*2), dtype=np.int16).tobytes())

    except Exception as e:
        print(repr(e))
        
        print("occured for lines: ")
        print(g[2])
        print(g[1])


    ln_cnt += 1

Run it with python3.9 and use python3.9 -m pip install to install the dependencies such as PyTorch.

This took maybe five hours to generate on my i7 6700HQ laptop. And btw I counted 13 exceptions either Exception("Model couldn't generate your text, probably it's too long") or one was UserWarning: Text string is longer than 1000 symbols.. This means I think the text is too big or there were some symbols or something it can't handle. I will investigate. ValueError(s) don't seem to be much of an issue tho.

There were 2155 translation pairs in total (most being large paragraphs) so missing 13 isn't a huge deal. The format of the file is separated by \t and \n. It comes in chunks where the paragraphs in different languages are seperated by the tabs and those chunks where the parallel translation moves on to the next set of equivalent paragraphs are separated by new lines. English is at index 1 and spanish at index 2.

Can't wait to use this tomorrow on my walks.

1

This has some pretty interesting computational chemistry material in it.

1
submitted 2 years ago by holdengreen@lemmygrad.ml to c/python@lemmy.ml

It's faster now, great.

0

The politics are actually mostly pretty good in this.

1

koko.org

1
1
submitted 2 years ago* (last edited 2 years ago) by holdengreen@lemmygrad.ml to c/vocaloid@lemmygrad.ml

classic

The vocaloid version I am familiar with: https://youtu.be/FNXPBGaUIfU

1
1

Months ago a ordered over $100 of components to complete a custom watercooling rig/loop for my workstation which I have begun to document in !gem and which should be completed shortly by the end of this year.

But I am still waiting for most of them which have been stuck at the 'customs clearance complete" stage for quite a while. Now most of those have been marked as complete in aliexpress and I have 15 days to file a dispute.

I will shortly try to pull up their tracking numbers and see if there is movement in the next couple of days. But I think I need to do the dispute.

Protectionists stop being lil *****.

1
submitted 2 years ago* (last edited 2 years ago) by holdengreen@lemmygrad.ml to c/market@lemmygrad.ml

They offered $65 + $16 shipping. The Instinct MI25 is not much more, $130, and just better. I will prob not even use the S9150 much unless I need the FP64 for something because it's relatively slow and power hungry.

I hope this community is ok for this site.

Edit: wow unixsurplusnet (ebay) is selling it for $99. gonna wait till the end of the year prob when I finish the workstation.

they have good hard drive and PSU deals too.

[-] holdengreen@lemmygrad.ml 2 points 2 years ago* (last edited 2 years ago)

Federated Ebay. Anything riscv. Middleware, tools for games and contribution to existing FOSS games and engines.

And there are probably a ton of little things out there... (specifically to make Linux and FOSS more competitive with proprietary brands in every day usage and specific niches.)

I think it's good to ask comrades these questions who may not have time or expertise on their own.

[-] holdengreen@lemmygrad.ml 1 points 2 years ago

I'm on California but there would likely be competition.

[-] holdengreen@lemmygrad.ml 2 points 2 years ago* (last edited 2 years ago)

It’s only illegal of you commit a crime while bypassing the firewall, like if you were posting on a Western porn site or something, in which case it could be used to increase sentencing in court.

Do people actually get sentenced in China for amateur porn? (not the stated context specifically I assume)

[-] holdengreen@lemmygrad.ml 2 points 2 years ago

Whichever one doesn't end in nuclear exchange.

[-] holdengreen@lemmygrad.ml 1 points 2 years ago

well said. no mercy on the fascists and let's take the help we can get, play it cool and smart. We don't need to make martyrs of ourselves.

[-] holdengreen@lemmygrad.ml 1 points 2 years ago

I bet you those genUSAers are just a bunch of drooling imbreds irl. They are mere flees.

[-] holdengreen@lemmygrad.ml 1 points 2 years ago

proof the gusano's were a mistake

[-] holdengreen@lemmygrad.ml 1 points 2 years ago

try not to ...

[-] holdengreen@lemmygrad.ml 2 points 2 years ago

Was supposed to be a joke but took them six genuine replies until someone called me out.

[-] holdengreen@lemmygrad.ml 1 points 2 years ago

GenZedong was 90% why I used reddit

[-] holdengreen@lemmygrad.ml 1 points 2 years ago

we should do our part and not expect China to do everything itself

view more: next ›

holdengreen

joined 2 years ago
MODERATOR OF