开发者社区 > 云原生 > Serverless > 正文

options 在哪里增加 ?

options 在哪里增加 ?

sd 报错求破 : A tensor with all NaNs was produced in VAE. This could be because there's not enough precision to represent the picture. Try adding --no-half-vae commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check. Time taken: 17.13sTorch active/reserved: 10932/13828 MiB, Sys VRAM: 14867/14961 MiB (99.37%)

展开
收起
大圣东游 2023-06-08 14:26:35 132 0
4 条回答
写回答
取消 提交回答
  • 可以先问下Google老师,然后试一下

    回答8.png

    https://huggingface.co/andite/anything-v4.0/discussions/23

    此答案来自钉钉群“阿里函数计算官网客户"

    2023-06-08 18:04:01
    赞同 展开评论 打赏
  • 公众号:网络技术联盟站,InfoQ签约作者,阿里云社区签约作者,华为云 云享专家,BOSS直聘 创作王者,腾讯课堂创作领航员,博客+论坛:https://www.wljslmz.cn,工程师导航:https://www.wljslmz.com

    在阿里云函数计算中,您可以在代码中设置函数的配置项,包括入口函数名称、运行环境、内存限制、超时时间等。您可以通过 options 参数来设置这些配置项。具体来说,您可以在代码中使用如下方式来设置 options 选项:

    def handler(event, context, options):
        # your function code here
    

    在函数代码中,您可以将 options 参数定义为一个字典,并将相关配置项放入其中。例如,以下代码使用 options 参数设置了入口函数名称和内存限制:

    def handler(event, context, options):
        options['function_name'] = 'my_function'
        options['memory_limit_mb'] = 256
        # your function code here
    

    这样,在函数执行时,函数计算会根据 options 中的配置项来运行函数。

    关于 sd 报错,您可以尝试按照报错提示信息的建议,添加 --no-half-vae 参数来解决该问题。具体来说,您可以在代码中使用以下方式来设置 options 参数:

    def handler(event, context, options):
        options['cmd'] = '--no-half-vae'
        # your function code here
    

    这样,在函数启动时,函数计算会将 --no-half-vae 参数传递给程序,从而解决出现 NaN 值的问题。另外,如果您不想进行 NaN 检查,也可以使用 --disable-nan-check 参数来禁用该检查。

    2023-06-08 15:50:04
    赞同 展开评论 打赏
  • 函数计算的Options可以在函数部署时进行设置,具体设置方法如下:

    1、在命令行中使用--config参数,指定函数部署时的配置文件,例如:

    fun deploy --config ./template.yml
    

    2、在配置文件template.yml中,使用Properties字段指定函数的Options,例如:

    ROSTemplateFormatVersion: '2015-09-01'
    Transform: 'Aliyun::Serverless-2018-04-03'
    Resources:
      myFunction:
        Type: 'Aliyun::Serverless::Function'
        Properties:
          Handler: index.handler
          Runtime: nodejs12
          CodeUri: ./
          MemorySize: 128
          Timeout: 60
          Properties:
            Description: This is my function.
    

    在上述示例中,我们使用Properties字段指定了函数的Options,包括函数的描述等。

    2023-06-08 15:39:54
    赞同 1 展开评论 打赏
  • 阿里云函数计算提供了多种方式来设置函数的配置选项,其中最常用的方式是通过函数计算的命令行工具 fun 进行配置。

    您可以使用 fun deploy 命令来部署函数,并在 template.yml 中添加 options 配置项,示例如下:

    ROSTemplateFormatVersion: '2015-09-01'
    Transform: 'Aliyun::Serverless-2018-04-03'
    Resources:
      myFunction:
        Type: 'Aliyun::Serverless::Function'
        Properties:
          Handler: index.handler
          Runtime: python3.6
          CodeUri: ./
          MemorySize: 128
          Timeout: 60
          EnvironmentVariables:
            key: value
          Events:
            Timer:
              Type: Timer
              Properties:
                CronExpression: '0 0/1 * * *'
                Enable: true
          Options:
            NasConfig:
              UserId: 10003
              GroupId: 10003
              MountPoints:
                - ServerPath: /mnt/nas
                  LocalPath: /mnt/nas
    

    以上示例中的 Options 配置项用于设置函数的 NAS 挂载点配置。您可以根据需要修改 Options 配置项中的内容。

    至于您提到的报错,可能是由于模型输出了 NaN 值导致的,建议您尝试添加 --disable-nan-check 命令行参数来禁用 NaN 检查,或者尝试使用更高精度的数据类型来避免这个问题。

    2023-06-08 14:42:37
    赞同 展开评论 打赏
问答地址:

快速交付实现商业价值。

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载