ms-agent icon indicating copy to clipboard operation
ms-agent copied to clipboard

name 'history' is not defined in modelscope-agent/apps/msgpt/predict.py file

Open KaedinLian opened this issue 1 year ago • 5 comments

When I click regenerate button, I got NameError: name 'history' is not defined Is it normal to not define the history variable in advance? How can I solve my problem? The pictures show the specific phenomena and background errors I encountered. image

user_input: 讲一个小男孩的故事,20字左右
upload_image_url: 
Traceback (most recent call last):
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/gradio/queueing.py", line 407, in call_prediction
    output = await route_utils.call_process_api(
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/gradio/route_utils.py", line 226, in call_process_api
    output = await app.get_blocks().process_api(
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/gradio/blocks.py", line 1550, in process_api
    result = await self.call_function(
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/gradio/blocks.py", line 1199, in call_function
    prediction = await utils.async_iteration(iterator)
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/gradio/utils.py", line 519, in async_iteration
    return await iterator.__anext__()
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/gradio/utils.py", line 512, in __anext__
    return await anyio.to_thread.run_sync(
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread
    return await future
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/gradio/utils.py", line 495, in run_sync_iterator_async
    return next(iterator)
  File "/data/lhj/miniconda3/envs/RL/lib/python3.10/site-packages/gradio/utils.py", line 649, in gen_wrapper
    yield from f(*args, **kwargs)
  File "/data/lhj/code/modelscope-agent/apps/msgpt/predict.py", line 20, in stream_predict
    if len(history) == 0:
NameError: name 'history' is not defined

KaedinLian avatar Jan 18 '24 03:01 KaedinLian

I will be very grateful for your answers and help.

KaedinLian avatar Jan 18 '24 03:01 KaedinLian

您好,可以提供一下您使用的模型以及代码吗?您可以先使用release/0.3.0分支的apps/agentfabric的方式构建,近期我们会发布新版本来优化已知的问题

mushenL avatar Jan 31 '24 09:01 mushenL

您好,可以提供一下您使用的模型以及代码吗?您可以先使用release/0.3.0分支的apps/agentfabric的方式构建,近期我们会发布新版本来优化已知的问题

应该是master。当时参考readme用git clone [https://github.com/modelscope/modelscope-agent.git下载的。后来注释掉history后解决了。 另外,安装配置环境花了很多时间,因为有些版本依赖并没有在requirement里。请问有易于使用是docker版本吗,考虑下次发布docker版本吗?

KaedinLian avatar Feb 07 '24 13:02 KaedinLian

您好,有相关的镜像可以尝试拉取下面这个镜像 registry.cn-hangzhou.aliyuncs.com/modelscope/modelscope-agent:v0.3.0 或者使用modelscope的官方镜像也是可以的

mushenL avatar Feb 23 '24 02:02 mushenL

d

您好,可以提供一下您使用的模型以及代码吗?您可以先使用release/0.3.0分支的apps/agentfabric的方式构建,近期我们会发布新版本来优化已知的问题

应该是master。当时参考readme用git clone [https://github.com/modelscope/modelscope-agent.git下载的。后来注释掉history后解决了。 另外,安装配置环境花了很多时间,因为有些版本依赖并没有在requirement里。请问有易于使用是docker版本吗,考虑下次发布docker版本吗?

docker版本后续安排,开发中

zzhangpurdue avatar Mar 12 '24 11:03 zzhangpurdue