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
# core mixins | |
from tenant_schemas.test.client import TenantClient | |
from rest_framework.test import APIClient | |
class My24ApiClient(TenantClient, APIClient): | |
pass | |
# core fixtures.py | |
from tenant_schemas.utils import get_public_schema_name, tenant_context |
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 | |
# The export path contains the name and the version of the model | |
tf.keras.backend.set_learning_phase(0) # Ignore dropout at inference | |
model = tf.keras.models.load_model('./inception.h5') | |
export_path = '../my_image_classifier/1' | |
# Fetch the Keras session and save the model | |
# The signature definition is defined by the input and output tensors | |
# And stored with the default serving key |
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
class Product(models.Model): | |
# other fields | |
image = models.FileField(storage = MogileFSStorage(), upload_to = 'product_images') | |
from django.core.files import File | |
from django.core.files.temp import NamedTemporaryFile | |
product = Product() | |
# set all your variables here | |
product.save() |