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 copy | |
import json | |
from pathlib import Path | |
from typing import Any, Dict, Optional | |
def openapi_to_json_schema( | |
openapi_path: str, | |
output_path: str, | |
root_schema_name: Optional[str] = None | |
) -> None: |
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
-- accounts_tags definição | |
CREATE TABLE "accounts_tags" ("account_id" bigint NOT NULL, "tag_id" bigint NOT NULL, PRIMARY KEY ("tag_id", "account_id")); | |
CREATE INDEX "index_accounts_tags_on_account_id_and_tag_id" ON "accounts_tags" ("account_id", "tag_id"); | |
-- account_warning_presets definição | |
CREATE TABLE "account_warning_presets" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text DEFAULT '' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "title" varchar DEFAULT '' NOT NULL); |
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
// pages/api/webdav/[[...file]].ts | |
import type { NextApiRequest, NextApiResponse } from 'next'; | |
import { v2 as webdav } from 'webdav-server'; | |
export const config = { | |
api: { | |
// Desabilita o bodyParser para preservar o corpo "cru" da requisição, essencial para WebDAV. | |
bodyParser: false, | |
}, | |
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import re | |
from langchain.text_splitter import RecursiveCharacterTextSplitter | |
import tiktoken | |
# Define o limite de caracteres para cada split | |
chunk_size = 200 | |
# Função para remover separadores de um texto | |
def remove_separators(text, separators): | |
pattern = '|'.join(map(re.escape, separators)) |
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 csv | |
# Define o caminho do arquivo de entrada e de saída | |
input_file_path = 'TXITENS.BKP' | |
output_file_path = 'TXITENS.CSV' | |
# Define os campos e seus tamanhos de acordo com a especificação | |
fields = [ | |
("Código do Departamento", 2), ("Tipo de Produto", 1), ("Código do Item", 8), | |
("Preço (R$/kg ou R$/Unidade)", 6), ("Dias de Validade", 3), |
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 transformers import LEDForConditionalGeneration, LEDTokenizer | |
tokenizer = LEDTokenizer.from_pretrained('allenai/led-large-16384') | |
model = LEDForConditionalGeneration.from_pretrained('allenai/led-large-16384') | |
inputs = tokenizer.encode("Lorem Ipsum is simply dummy text of the printing and typesetting industry.", return_tensors="pt") | |
# Generate Summary with higher repetition penalty | |
summary_ids = model.generate(inputs, num_beams=4, max_length=1024, repetition_penalty=2.0) | |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True) |
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
// https://webbrowsertools.com/screen-size | |
class Screen { | |
constructor() { | |
ratio: 8; | |
} | |
gcd(a, b) { | |
return 0 === b ? a : this.gcd(b, a % b); | |
} |
NewerOlder