Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Learn, unlearn and relearn.

Sayak Paul sayakpaul

:octocat:
Learn, unlearn and relearn.
View GitHub Profile
View bing_downloader.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View requirements.txt
pygments>=2.7.4
jinja2
markdown
requests
mdx_truly_sane_lists
sphinx~=3.0.3
black==19.10b0
pathlib
tensorflow-gpu==2.6.0
PyYAML
View new_etci_order_2.csv
0 redrivernorth_20190104t002247_x-0_y-0
1 redrivernorth_20190104t002247_x-0_y-1
2 redrivernorth_20190104t002247_x-0_y-10
3 redrivernorth_20190104t002247_x-0_y-11
4 redrivernorth_20190104t002247_x-0_y-2
5 redrivernorth_20190104t002247_x-0_y-3
6 redrivernorth_20190104t002247_x-0_y-4
7 redrivernorth_20190104t002247_x-0_y-5
8 redrivernorth_20190104t002247_x-0_y-6
9 redrivernorth_20190104t002247_x-0_y-7
View new_etci_order.csv
0 redrivernorth_20190104t002247_x-0_y-12
1 redrivernorth_20190104t002247_x-0_y-13
2 redrivernorth_20190104t002247_x-0_y-14
3 redrivernorth_20190104t002247_x-0_y-15
4 redrivernorth_20190104t002247_x-0_y-16
5 redrivernorth_20190104t002247_x-0_y-17
6 redrivernorth_20190104t002247_x-0_y-18
7 redrivernorth_20190104t002247_x-0_y-19
8 redrivernorth_20190104t002247_x-0_y-20
9 redrivernorth_20190104t002247_x-0_y-21
View Dockerfile
FROM pytorch/pytorch:latest
WORKDIR /app
# install the dependencies
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY . .
# set up environment variables
View redis_config.py
# REDISHOST is the IP address to the MemoryStore instance
redis_host = os.environ.get("REDISHOST", "localhost")
redis_port = int(os.environ.get("REDISPORT", 6379))
redis_client = redis.StrictRedis(host=redis_host, port=redis_port)
View benchmarking_clip.py
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
start_time = time.time()
for _ in range(1000):
with torch.no_grad():
model = model.to(DEVICE)
inputs = processor(text=[semantic_search_phrase],
images=all_images, return_tensors="pt", padding=True)
inputs = inputs.to(DEVICE)
outputs = model(**inputs)
View gke_deploy_output.txt
NAME ADDRESS/RANGE TYPE PURPOSE NETWORK REGION SUBNET STATUS
gde 34.149.231.34 EXTERNAL IN_USE
View probe.yaml
livenessProbe:
httpGet:
path: /alive
port: 8080
initialDelaySeconds: 90
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
View flask_probes.py
from flask_healthz import healthz
from flask_healthz import HealthError
app = Flask(__name__)
app.register_blueprint(healthz, url_prefix="/")
def printok():
print("Everything is fine")