You have to already have these in your system:
- Python. Version 3.6+ is highly recommended.
- Official CPython from python.org
- Anaconda
- (Recommended) Miniconda
// Based on tinrtgu's Python script here: | |
// https://www.kaggle.com/c/avazu-ctr-prediction/forums/t/10927/beat-the-benchmark-with-less-than-1mb-of-memory | |
package main | |
import ( | |
"encoding/csv" | |
"os" | |
"strconv" | |
"hash/fnv" | |
"math" |
# Adapted from: https://github.com/google-research/big_transfer/blob/6c83d6459e009fa89d84c1e904611e9b162e6eff/bit_pytorch/models.py | |
# Copyright 2020 Google LLC | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
begin | |
tmp1 = @async sleep(20) | |
tmp2 = @async sleep(30) | |
@time fetch(tmp1) | |
@time fetch(tmp2) | |
end |
import io | |
import os | |
import logging | |
import torch | |
import torch.nn.functional as F | |
import numpy as np | |
from PIL import Image | |
from torch.autograd import Variable | |
from torchvision import transforms |
import re | |
def cjk_detect(texts): | |
# korean | |
if re.search("[\uac00-\ud7a3]", texts): | |
return "ko" | |
# japanese | |
if re.search("[\u3040-\u30ff]", texts): | |
return "ja" |
You have to already have these in your system: