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 os | |
def check_notebook(): | |
if os.environ.get('COLAB_GPU', False): | |
return "colab" | |
elif os.environ.get('KAGGLE_DATA_PROXY_TOKEN', True): | |
return "kaggle" | |
else: | |
return False |
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
function KeepClicking(){ | |
console.log("Clicking"); | |
document.querySelector("colab-connect-button").click() | |
} | |
setInterval(KeepClicking,60000) |
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
sed -i 's/#bind-address.*= 127.0.0.1/bind-address\t= 0.0.0.0/' mysqld.cnf | |
# Should allow any host to connect to mysql database |
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
def index(): | |
with f: | |
f.index_lines(['abc', 'cde', 'efg'], batch_size=64, read_mode='r', size=num_docs) |
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
def index(): | |
with f: | |
f.index_lines(filepath='data/startrek_tng.csv', batch_size=64, read_mode='r', size=num_docs) |
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
num_docs = os.environ.get('MAX_DOCS', 50000) |
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
num_docs = os.environ.get('MAX_DOCS', 500) |
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
{ | |
"matchDoc": { | |
"docId": 421, | |
"weight": 1.0, | |
"mimeType": "text/plain", | |
"text": "WORF!Vessel unknown, configuration unknown, sir.\n" | |
}, | |
"score": { | |
"value": 0.748656, | |
"opName": "BiMatchRanker" |
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 jina.flow import Flow | |
# other code here | |
def index(): | |
f = Flow.load_config('flows/index.yml') |
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
!Flow | |
with: | |
logserver: true | |
pods: | |
crafter: | |
yaml_path: pods/craft.yml | |
read_only: true | |
encoder: | |
yaml_path: pods/encode.yml | |
replicas: $REPLICAS |
OlderNewer