Skip to content

Instantly share code, notes, and snippets.

@lasp73
lasp73 / Usando_LLM_Mistral_7B_para_gerar_texto.ipynb
Created April 13, 2024 02:24
Usando o modelo Mistral-7B para responder instruções
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lasp73
lasp73 / embeddings.py
Created July 4, 2022 15:03
Helper classes to work with embeddings in scikit-learn
import logging
from abc import ABC, abstractmethod
from typing import Callable
import numpy as np
import pandas as pd
from gensim.models import KeyedVectors, Word2Vec
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.feature_extraction.text import TfidfVectorizer
@lasp73
lasp73 / st_demo_settings.py
Created June 13, 2021 01:26 — forked from okld/multipage_settings_app.py
Streamlit - Settings page with session state
import streamlit as st
from streamlit.hashing import _CodeHasher
try:
# Before Streamlit 0.65
from streamlit.ReportThread import get_report_ctx
from streamlit.server.Server import Server
except ModuleNotFoundError:
# After Streamlit 0.65
from streamlit.report_thread import get_report_ctx
@lasp73
lasp73 / mvn-docker.sh
Last active October 2, 2020 12:36
Compile using Maven inside Docker
#!/bin/bash
MVN_CMD="docker run -t --rm -u $(id -u $USER):$(id -g $USER) \
-v $HOME/.m2:/mnt/maven/.m2 \
-v $PWD:/mnt/code \
-w /mnt/code \
-e MAVEN_CONFIG=/mnt/maven/.m2 \
maven:3-jdk-8 mvn -Duser.home=/mnt/maven"
$MVN_CMD "$@"
@lasp73
lasp73 / get-audio-max.sh
Last active October 2, 2020 13:25
Scripts to get the maximum amplitude from audio files and plot histogram
#!/bin/bash
AUDIODIR=$1
helpmsg="get-audio-max.sh <input directory>"
[[ -n "$AUDIODIR" ]] || \
{
echo "You must inform the input directory with the RAW audio files";
echo $helpmsg;