我正在使用pyproject
和构建一个 Python 包poetry
。我的pyproject.toml
看起来像这样:
[tool.poetry]
authors = ["test"]
description = ""
name = "test"
version = "0.1.0"
[tool.poetry.dependencies]
spacy = {extras = ["cuda113"], version = "^3.2.3"}
faiss-gpu = {version = "1.7.2", optional = true}
[tool.poetry.extras]
gpu = ["faiss-gpu"]
Run Code Online (Sandbox Code Playgroud)
这将faiss-gpu
作为额外使用成功安装poetry install -E gpu
。
但是,我想仅在提供spacy[cuda113]
时安装(GPU 版本) 。poetry install -E gpu
正常poetry install
的应该只安装spacy
(CPU版本)。
我尝试过使用以下配置,但这使得所有配置都是spacy
可选的并且不会安装它。只有spacy[cuda113]
(GPU 版本)必须是可选的。
[tool.poetry]
authors = ["test"]
description = ""
name …
Run Code Online (Sandbox Code Playgroud) 我想使用boto3 athena 客户端函数start_query_execution
从 Python 运行查询。此处的函数文档:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/athena.html#Athena.Client.start_query_execution
用法如下:
query = "SELECT * FROM TABLE"
athena_client = boto3.client("athena")
start_response = athena_client.start_query_execution(
QueryString=query,
QueryExecutionContext={"Database": ATHENA.database_name},
ResultConfiguration={
"OutputLocation": s3_output,
},
)
Run Code Online (Sandbox Code Playgroud)
我正在寻找一个函数/包装器,以确保此查询成功运行,并且仅在运行完成后才返回。从我的搜索中找不到 aws 包装器。
我在 Google Colab 上使用 Pytorch 运行我的 Jupyter Notebook。在我收到“Cuda 断言失败:设备端断言触发”之后,我无法运行任何其他使用我的 pytorch 模块的代码。有谁知道如何重置我的代码,以便我之前工作的 Pytorch 函数仍然可以运行?
我已经尝试实现,CUDA_LAUNCH_BLOCKING=1
但我的代码仍然无法工作,因为断言仍然被触发!
尝试运行时,我使用 Terraform AWS Provider 收到以下错误terraform plan
。仅当在 GitHub Actions 上运行时才会发生这种情况(在本地工作正常)
配置 Terraform AWS Provider 时出错:无法获取共享配置文件
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.22"
}
}
required_version = ">= 1.1.7"
}
Run Code Online (Sandbox Code Playgroud)
如果我降级到version = "~> 3.0"
它就可以解决问题。但我想升级到最新版本。
有没有办法让它在 CI 上运行?