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
| import os | |
| from google.cloud import storage | |
| # Set project and service account | |
| os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="service_account_key.json" | |
| os.environ["GCP_PROJECT"]="PROJECT_NAME" | |
| # init GCS | |
| storage_client = storage.Client() | |
| # the name for the bucket |
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
| <script src="https://unpkg.com/@tensorflow/tfjs"></script> | |
| <script src="https://unpkg.com/@tensorflow/tfjs-automl"></script> | |
| <p><input type="file" accept="image/*" name="image" id="file" onchange="loadFile(event)" style="display: none;"></p> | |
| <p><label for="file" style="cursor: pointer;">Upload Image</label></p> | |
| <p><img id="output" width="200" /></p> | |
| <p><pre id = "result"></pre></p> | |
| <script> | |
| async function run() { | |
| const model = await tf.automl.loadImageClassification('api_list/model.json'); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| # install package & env | |
| ! pip install simpletransformers | |
| ! pip install torchvision | |
| # setting parameter of model | |
| from simpletransformers.classification import ClassificationModel | |
| train_args={ | |
| 'num_train_epochs': 1, | |
| 'train_batch_size': 16, | |
| 'eval_batch_size': 64, |
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
| SELECT DISTINCT * | |
| FROM ML.PREDICT(MODEL `cloud-training-prod-bucket.movies.movie_recommender`, | |
| ( | |
| WITH | |
| allUsers AS ( | |
| SELECT DISTINCT userId | |
| FROM movies.movielens_ratings ), | |
| oneMovie AS( |