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
# It's created by Serkan UYSAL; github:uysalserkan | |
# Set up git variables | |
autoload -Uz vcs_info | |
zstyle ':vcs_info:*' check-for-changes true | |
zstyle ':vcs_info:*' unstagedstr '%F{red}*' | |
zstyle ':vcs_info:*' stagedstr '%F{yellow}+' | |
zstyle ':vcs_info:*' actionformats '%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f ' | |
zstyle ':vcs_info:*' formats '%F{5}[%F{2}%b%c%u%F{5}]%f ' | |
zstyle ':vcs_info:svn:*' branchformat '%b' |
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
# Thnaks to SeaseLtd/vector-search-elastic-tutorial | |
import elasticsearch | |
from pathlib import Path | |
from eland.ml.pytorch import PyTorchModel | |
from eland.ml.pytorch.transformers import TransformerModel | |
# Elastic configuration. | |
ELASTIC_ADDRESS = "http://localhost:9200" | |
# Uncomment the following lines if start ES with SECURITY ENABLED. | |
#ELASTIC_ADDRESS = "https://localhost:9200" |
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
def timeout_decorator(timeout): | |
def decorator(func): | |
@wraps(func) | |
def wrapper(*args, **kwargs): | |
result_queue = multiprocessing.Queue() | |
def target_func(queue, *args, **kwargs): | |
try: | |
result = func(*args, **kwargs) | |
queue.put(result) |
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
#!/bin/sh | |
# Check fisrt parameter and run python script with it | |
if [ "$1" = "ui" ]; then | |
streamlit run ui.py | |
elif [ "$1" = "api" ]; then | |
python3 api.py | |
else | |
echo "Invalid run type, please use 'ui' or 'api'." | |
fi |
OlderNewer