Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# hydra里基于LLM的SmartMonkey到底是如何实现有点疑问? #593

Open
bolt163 opened this issue Sep 14, 2023 · 6 comments
Open

# hydra里基于LLM的SmartMonkey到底是如何实现有点疑问? #593

bolt163 opened this issue Sep 14, 2023 · 6 comments

Comments

@bolt163
Copy link

bolt163 commented Sep 14, 2023

看PR稿里实现了基于LLM的 monkey智能探索,对里面的实现比较感兴趣,看完一头雾水有两个疑问向大神们请教下

##1.center里有几个对openapi的封装,但似乎都没看到实际调用的地方,看代码好像没看到代码里有实质调用LLM模型的地方

##2.agent里SmartMonkey,与LLM模型相关的api,version等参数都在 SmartTestParam这个类里定义,但最终传来传去,实际最后程序运行时是收归到了runSmartTestOnce函数,然后如果能执行到,则是进入 smartTestUtil.runPYFunction(smartTestParam, logger);
看这个函数的执行 最后是在执行一段python脚本,非常不解的是代码实现有必要写这么绕吗?
public String runPYFunction(SmartTestParam smartTestParam, Logger logger) throws Exception {
File smartTestFolder = new File(smartTestParam.getOutputFolder(), Const.SmartTestConfig.RESULT_FOLDER_NAME);
smartTestFolder.mkdir();
String res = null;
String[] runArgs = new String[9];
runArgs[0] = "python";
runArgs[1] = filePath;
runArgs[2] = smartTestParam.apkPath;
runArgs[3] = smartTestParam.deviceInfo;
runArgs[4] = smartTestParam.modelInfo;
runArgs[5] = smartTestParam.testSteps;
runArgs[6] = smartTestParam.stringTextFolder;
runArgs[7] = smartTestFolder.getAbsolutePath();
runArgs[8] = smartTestParam.llmInfo;

    for (String tempArg : runArgs) {
        logger.info(tempArg);
    }
    Process proc = Runtime.getRuntime().exec(runArgs);
    SmartTestLog err = new SmartTestLog(proc.getErrorStream(), logger);
    SmartTestLog out = new SmartTestLog(proc.getInputStream(), logger);
    err.start();
    out.start();
    res = out.getContent();
    proc.waitFor();

    return res;
}

然后这里面的filePath, smartTestParam参数 以及所执行到的python文件 PY_FILE_NAME 都是在 hydralab\common\util 目录的 Const.java里所定义。。感觉有点乱七八糟的代码

##3.上面的 smartTestParam参数,涉及 BERT_MODEL_NAME, TOPIC_MODEL_NAME等模型参数的定义,猜测最终SmartMonkey是基于这两个模型来做决策的么,是在线or离线的Reference?这里能在文档里注明出来么,看的有点云里雾里

@hydraxman
Copy link
Member

感谢反馈,这个我们整理一下给你个答复,主要是目前代码分散在Java Python Javascript中,确实比较乱,还有一部分在内部代码库。

我们计划在9月份梳理清楚。 cc @zhou9584

@nathan2win
Copy link
Collaborator

我们最近没有发PR稿,你说的可能是采访稿,暂时没有PR的需求。。。

目前代码实现是多个团队完成的,涉及到脱敏和专利保护问题,我们开源会一步一步来,可以继续关注下代码更新。

如果是贵公司想寻求合作,我们可以私信沟通。

针对“上面的 smartTestParam参数,涉及 BERT_MODEL_NAME, TOPIC_MODEL_NAME等模型参数的定义,猜测最终SmartMonkey是基于这两个模型来做决策的么”

你的理解是正确的,一个模型用于分类和理解,一个用于强化学习场景下的决策。这两个模型的细节可能没法公开,不过其实不一定要用模型。。。

感谢你的问题和宝贵意见。

@hydraxman
Copy link
Member

hydraxman commented Sep 19, 2023

初步想法是分三步走:

  1. 搞一个分支先把一部分smart test的接口开源,具体的实现先不开源。
  2. 开源缺省实现(需要评估哪个部分可以在满足微软合规要求的情形下开源)
  3. 实现开源方案可运行。

@kabuqNo
Copy link
Contributor

kabuqNo commented Oct 9, 2023

same ask

@GZL11
Copy link

GZL11 commented Mar 11, 2024

我也想知道目前LLM在项目中扮演了一个怎样的角色,可以完成哪些功能,LLM在这些方面的效果如何?

@hydraxman
Copy link
Member

Will update soon. Thanks for all the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants