This file contains 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
--- | |
- hosts: newnode | |
remote_user: root | |
become: yes | |
become_method: sudo | |
tasks: | |
- command: bash -c "uname -r | grep ^4." | |
register: kernelversion | |
ignore_errors: yes |
This file contains 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 centos:7 | |
MAINTAINER "orion" <orion@thoughtspot.com> | |
# Steps needed to use systemd enabled docker containers. | |
# Reference: https://hub.docker.com/_/centos/ | |
ENV container docker | |
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ | |
systemd-tmpfiles-setup.service ] || rm -f $i; done); \ | |
rm -f /lib/systemd/system/multi-user.target.wants/*;\ | |
rm -f /etc/systemd/system/*.wants/*;\ |
This file contains 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 tensorflow as tf | |
import tensorflow_hub as hub | |
from tensorflow.saved_model import simple_save | |
export_dir = "./models/use/00000001" | |
with tf.Session(graph=tf.Graph()) as sess: | |
module = hub.Module("https://tfhub.dev/google/universal-sentence-encoder-multilingual-large/1") | |
text_input = tf.placeholder(dtype=tf.string, shape=[None]) | |
sess.run([tf.global_variables_initializer(), tf.tables_initializer()]) |
This file contains 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
# Connect to the semantic-search service and run the query | |
con = get_victor_connection() | |
response = con.FindTopKProblems( | |
victor_pb2.TopKProblemsRequest( | |
query=search_query, | |
# In our implementation -1 means "return all matches" | |
k=-1, | |
), | |
) |
This file contains 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 python:3.6 | |
RUN apt-get update -y | |
RUN apt-get install -y unzip wget | |
RUN apt-get install -y default-jdk | |
RUN wget http://h2o-release.s3.amazonaws.com/h2o/rel-wolpert/8/h2o-3.18.0.8.zip | |
RUN unzip ./h2o-3.18.0.8.zip | |
RUN mv h2o-3.18.0.8/h2o.jar /tmp/ |
This file contains 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
state_dir = './search_data/' | |
faiss.write_index( | |
index, | |
os.path.join(state_dir, "faiss.index") | |
) | |
index = faiss.read_index( | |
os.path.join(state_dir, "faiss.index") | |
) |
This file contains 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 faiss | |
from encoder import UniversalEncoder | |
# Don't forget to start the encoder container locally and open the 8501 port | |
encoder = UniversalEncoder(host='localhost', port=8501) | |
data = [ | |
'What color is chameleon?', | |
'When is the festival of colors?', | |
'When is the next music festival?', |
This file contains 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 logging | |
from abc import ABC, abstractmethod | |
from typing import Iterable, List | |
import requests | |
import numpy as np | |
logger = logging.getLogger(__name__) |
This file contains 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
syntax = "proto3"; | |
message TopKDocumentsRequest { | |
string query = 1; | |
int32 k = 2; | |
} | |
message DocumentsWithinDistanceRequest { | |
string query = 1; | |
double distance = 2; |
This file contains 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
# A status line theme generated by tmuxline.vim | |
if-shell "test -f ~/.tmuxline" "source ~/.tmuxline" | |
set -g default-terminal "screen-256color" | |
# Enables a true-color support in Tmux | |
set-option -ga terminal-overrides ",xterm-256color:Tc" | |
# Moving between panes. | |
bind h select-pane -L | |
bind j select-pane -D |
NewerOlder