All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.openservices.eas.predict.example Maven / Gradle / Ivy

package com.aliyun.openservices.eas.predict;

import com.aliyun.openservices.eas.predict.http.HttpConfig;
import com.aliyun.openservices.eas.predict.http.PredictClient;

public class example {
  public static void main(String[] args) throws Exception {
    PredictClient client = new PredictClient(new HttpConfig());
    client.setToken("ZDdhZjYwYzAzNTQ0NmQ3YWQxZDk2YTYwZjMxYzQ3NjlkYjY0YmJhYg==");
    // client.setToken(args[1]);
    client.setDirectEndpoint("pai-eas-internet.cn-hangzhou.aliyuncs.com");
    //client.setEndpoint("eas-shanghai.alibaba-inc.com");
    // client.setVIPServer(args[0]);
    client.setModelName("echo_test");
    //client.setToken(args[1]);

    String request = "[{}]";

    try {
      for (int i = 0; i < 10000000; i++) {
        String response = client.predict(request);
        System.out.println(response);
        System.out.println("--------------------------------------------");
      }
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy