-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
新增功能自动断开colab的bug #78
Comments
我今天也注意到这个问题了,稍后会抽空修复。感谢。 |
自动断开这个功能我暂时关闭了,因为和google.colab.files.download这个方法有冲突。 |
我看了下files.py的源码,里面是用 js 异步构建了一个download函数(async),里面需要根据Kernel ID返回的数据量判断是否成功,而你在python环境下是直接同步调用sleep函数,让kernel无法返回数据,导致在调用js的download函数时一直在for循环中判断。所以不能直接在代码中调用sleep。我看到里面用 js 创建了一个channel,当下载发起之后,可以通过调用channel的send方法发消息给python程序,然后在python程序中添加接收即可,具体的代码可以参考:https://stackoverflow.com/questions/63263921/is-there-a-way-to-register-a-message-handler-callback-on-a-google-colab-kernel-c |
还有一个,就是下载成压缩包的功能,建议可以添加一个选项,让用户选择是否压缩,因为有的用户可能并没有压缩的习惯或打算。当然只是建议 |
嗯,这个我也觉得,今天改了一下,只有多个文件才以压缩包的形式下载 |
我看了下代码,你发起下载请求后,就直接调用sleep函数了,这样会导致下载请求无法发起,必须强制暂停代码运行才行,我用的是Google浏览器,其余Chromium浏览器也会出现这种情况
The text was updated successfully, but these errors were encountered: