Search in sources :

Example 56 with com.google.api.services.cloudresourcemanager.v3.model

use of com.google.api.services.cloudresourcemanager.v3.model in project java-automl by googleapis.

the class PredictionApiIT method setUp.

@Before
public void setUp() throws IOException, ExecutionException, InterruptedException, TimeoutException {
    // Verify that the model is deployed for prediction
    try (AutoMlClient client = AutoMlClient.create()) {
        ModelName modelFullId = ModelName.of(PROJECT_ID, "us-central1", modelId);
        Model model = client.getModel(modelFullId);
        if (model.getDeploymentState() == Model.DeploymentState.UNDEPLOYED) {
            // Deploy the model if not deployed
            DeployModelRequest request = DeployModelRequest.newBuilder().setName(modelFullId.toString()).build();
            Future future = client.deployModelAsync(request);
            future.get(30, TimeUnit.MINUTES);
        }
    }
    bout = new ByteArrayOutputStream();
    out = new PrintStream(bout);
    originalPrintStream = System.out;
    System.setOut(out);
}
Also used : DeployModelRequest(com.google.cloud.automl.v1.DeployModelRequest) PrintStream(java.io.PrintStream) ModelName(com.google.cloud.automl.v1.ModelName) Model(com.google.cloud.automl.v1.Model) Future(java.util.concurrent.Future) ByteArrayOutputStream(java.io.ByteArrayOutputStream) AutoMlClient(com.google.cloud.automl.v1.AutoMlClient) Before(org.junit.Before)

Example 57 with com.google.api.services.cloudresourcemanager.v3.model

use of com.google.api.services.cloudresourcemanager.v3.model in project java-automl by googleapis.

the class PredictionApiIT method setUp.

@Before
public void setUp() throws IOException, ExecutionException, InterruptedException, TimeoutException {
    // Verify that the model is deployed for prediction
    try (AutoMlClient client = AutoMlClient.create()) {
        ModelName modelFullId = ModelName.of(PROJECT_ID, "us-central1", modelId);
        Model model = client.getModel(modelFullId);
        if (model.getDeploymentState() == Model.DeploymentState.UNDEPLOYED) {
            // Deploy the model if not deployed
            DeployModelRequest request = DeployModelRequest.newBuilder().setName(modelFullId.toString()).build();
            Future future = client.deployModelAsync(request);
            future.get(30, TimeUnit.MINUTES);
        }
    }
    bout = new ByteArrayOutputStream();
    out = new PrintStream(bout);
    System.setOut(out);
}
Also used : DeployModelRequest(com.google.cloud.automl.v1beta1.DeployModelRequest) PrintStream(java.io.PrintStream) ModelName(com.google.cloud.automl.v1beta1.ModelName) Model(com.google.cloud.automl.v1beta1.Model) Future(java.util.concurrent.Future) ByteArrayOutputStream(java.io.ByteArrayOutputStream) AutoMlClient(com.google.cloud.automl.v1beta1.AutoMlClient) Before(org.junit.Before)

Example 58 with com.google.api.services.cloudresourcemanager.v3.model

use of com.google.api.services.cloudresourcemanager.v3.model in project xtext-core by eclipse.

the class Bug299395TestLanguageSemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == Bug299395Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug299395Package.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case Bug299395Package.SUB_MODEL:
                sequence_SubModel(context, (SubModel) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel)

Example 59 with com.google.api.services.cloudresourcemanager.v3.model

use of com.google.api.services.cloudresourcemanager.v3.model in project xtext-core by eclipse.

the class Bug305397SemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == Bug305397Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug305397Package.ELEMENT:
                sequence_Element(context, (Element) semanticObject);
                return;
            case Bug305397Package.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Element(org.eclipse.xtext.parsetree.impl.bug305397.Element) Model(org.eclipse.xtext.parsetree.impl.bug305397.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 60 with com.google.api.services.cloudresourcemanager.v3.model

use of com.google.api.services.cloudresourcemanager.v3.model in project xtext-core by eclipse.

the class Bug250313Test method testSTRINGConversion_01.

@Test
public void testSTRINGConversion_01() throws Exception {
    Model model = (Model) getModel("1 'str'");
    assertEquals("str", model.getValue());
    assertNotNull(lexerRule);
    assertEquals("org.eclipse.xtext.common.Terminals.STRING", lexerRule);
    assertTrue(node instanceof ILeafNode);
    assertEquals("'str'", string);
    assertEquals(1, convertCallCount);
}
Also used : ILeafNode(org.eclipse.xtext.nodemodel.ILeafNode) Model(org.eclipse.xtext.valueconverter.bug250313.Model) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)48 Model (org.eclipse.xtext.valueconverter.bug250313.Model)30 Model (com.google.cloud.aiplatform.v1.Model)16 AutoMlClient (com.google.cloud.automl.v1.AutoMlClient)16 Model (com.google.cloud.automl.v1.Model)16 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)16 LocationName (com.google.cloud.aiplatform.v1.LocationName)14 PipelineServiceClient (com.google.cloud.aiplatform.v1.PipelineServiceClient)14 PipelineServiceSettings (com.google.cloud.aiplatform.v1.PipelineServiceSettings)14 TrainingPipeline (com.google.cloud.aiplatform.v1.TrainingPipeline)14 InputDataConfig (com.google.cloud.aiplatform.v1.InputDataConfig)13 ModelContainerSpec (com.google.cloud.aiplatform.v1.ModelContainerSpec)13 FilterSplit (com.google.cloud.aiplatform.v1.FilterSplit)11 FractionSplit (com.google.cloud.aiplatform.v1.FractionSplit)11 PredefinedSplit (com.google.cloud.aiplatform.v1.PredefinedSplit)11 TimestampSplit (com.google.cloud.aiplatform.v1.TimestampSplit)11 Status (com.google.rpc.Status)11 Model (com.microsoft.z3.Model)11 DeployedModelRef (com.google.cloud.aiplatform.v1.DeployedModelRef)10 EnvVar (com.google.cloud.aiplatform.v1.EnvVar)10