#!/usr/bin/env bash
# Repo
curl -sS https://apertium.projectjj.com/apt/install-nightly.sh | sudo bash
# Install
sudo apt install libboost-dev libgoogle-perftools-dev libicu-dev cmake subversion build-essential pkg-config gawk libxml2 libxml2-dev libxml2-utils xsltproc flex automake libtool libpcre3-dev zlib1g-dev locales build-essential automake subversion git pkg-config libtool apertium-all-dev
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zabbix_utils import ZabbixAPI | |
import json | |
TOKEN = "FILLME" | |
API_URL = "" | |
api = ZabbixAPI(url=API_URL) | |
api.login(token=TOKEN) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from genericpath import isfile | |
from pdf2image import convert_from_path, pdfinfo_from_path | |
import collections, sys, os | |
from tqdm.auto import tqdm, trange | |
from glob import glob |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import requests as re | |
from tqdm.auto import tqdm | |
from pprint import pformat | |
from IPython import embed as IPy_embed | |
import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param([string]$P = (Get-Location).Path) | |
$dirs = get-childItem -Recurse -Depth 123456789 -Path $P | Where { (Get-ChildItem $_.FullName).count -eq 0 } | select -expandproperty FullName; | |
$vacio = $dirs | Where-Object { | |
Write-Progress " Checking $_ "; | |
(((Get-ChildItem "$_/").count -eq 0) -and ($_.ToLower() -notlike "*tmp*")) | |
} | ForEach-Object { | |
Write-Progress " Removing: $_ "; | |
Remove-Item -Force $_; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
from tqdm.auto import tqdm | |
from pprint import pprint | |
import csv | |
mails = list(csv.reader(open("inconvenientes042022.csv", "r", encoding="utf8"))) | |
mails.pop(0) | |
dataset = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from transformers.models.roberta import RobertaConfig, RobertaModel, RobertaTokenizer | |
# load model and tokenizer | |
tokenizer = RobertaTokenizer.from_pretrained('FacebookAI/roberta-base') | |
model = RobertaModel.from_pretrained('FacebookAI/roberta-base', is_decoder=True).to('cuda') | |
# tokenize inputs | |
text = 'hello world, this is a test' | |
inputs = tokenizer(text, return_tensors='pt').to('cuda') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import subprocess | |
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route('/api/translate', methods=['POST']) | |
def translate(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from torch import Tensor | |
import torch.nn as nn | |
class FunnelLayer(nn.Module): | |
def __init__(self, input_length: int, output_length: int, hidden_size: int, conv_size: int, num_heads, deconv: bool = False): | |
""" | |
Initialize the FunnelLayer. | |
Args: | |
input_length (int): The length of the input sequence. |
NewerOlder