Colab之上的简单UI [英] Simple UI on top of Colab

查看:154
本文介绍了Colab之上的简单UI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jupyter笔记本非常棒,Colab提供了一种与其他开发人员共享这些笔记本的好方法.但是,现在我希望与最终用户而不是开发人员共享Jupyter笔记本中的功能.后端有各种Python导入,3D投影和非线性优化问题的解决方案等,我需要从最终用户那里抽象出来.由于其非凡的功能,我宁愿不必将其移植到另一种语言,或者至少移植到另一种平台,尤其是因为它已经在工作.

Jupyter notebooks are awesome, and Colab provides a great way of sharing these to other developers. However, now I have a functionality in a Jupyter notebook that I would like to share with end users rather than developers. Backend there are various Python imports, 3D projections and solution of a non-linear optimization problem etc and I need to abstract that away from an end user. Due to its non-trivial functionality I would rather not have to port it to another language or at least not another platform, especially since it is already working.

但是,用于此功能的用户界面可能非常简单.用户应输入两个值,然后查看绘图和一些文本输出.

The user interface for this functionality can however be very simple. A user should input two values, then see a plot and some text output.

有用的是,如果我可以创建一个Colab文档,其中包含一些表格或可以使用共享链接共享的小部件.任何人都可以打开此文档,输入两个值,按一个按钮即可查看结果.如果许多人同时打开此文档,则可能会出现用户输入冲突的问题.但是可以解决这个问题吗?打开链接并输入值应该是用户唯一关心的问题.例如,他们不必按下shift + enter即可运行单元.双击单元格不应显示任何代码.不必在Playground中打开Colab文档.另一方面,我希望与人共享Google云端硬盘中的Colab文档,而不需要花更多的精力在网络服务业务上.至少没有什么比这困难得多.

What would be useful is if I could have a Colab document with a few forms or a widget that I could share using a shareable link. Anyone could open this document, enter two values, push a button and see the result. If many people open this document at the same time there could be problems, with conflicting user inputs. But there could be a work around to that? Opening the link and entering the values should be the only concern for the user. They should not have to push shift+enter to run a cell for instance. Double clicking a cell should not show any code. The Colab document should not have to be opened in Playground. I on the other hand wish not to have to put more effort into the web service business than sharing a Colab document from my Google Drive with people. At least nothing significantly harder than that.

这可行吗,还是我们仍然托管一个网站等来实现这种功能?

Is this feasible, or do we still host a website etc to achieve such a functionality?

推荐答案

Voila或appmode模块可以将Jupyter笔记本更改为webapp/类似于仪表板的界面.在此处那里有一个Voila示例画廊,因此您可以了解可能的情况.主要的Voila回购位于此处. Appmode的主要仓库位于此处,并对其进行了详细说明. (单击launch binder为有效示例.)此外,您可能对

Voila or the appmode module can change a Jupyter notebook into a webapp / dashboard-like interface. There is a gallery of Voila examples here so you can get a feel for what is possible. The main Voila repo is here. The main Appmode repo is here and describes it well. (Click launch binder for an active example.) In addition, you may be interested in this discussion.

您可以使用公共MyBinder/Binder服务启动活动会话,而无需托管网站.您可以在Github(或其他几个地方,如GitLab)上建立公共存储库,并通过触发在远程计算机上启动该存储库的URL将其连接到MyBinder.org服务,就可以共享您的功能.和其他人.例如,如果您在此处,然后单击launch binder,则会得到一些活跃的示例. (最近,我帮助了某人一个更简单的回购协议,该回购协议启动了一个回购协议. 此处,这可能会让您更好地了解使用Binder系统进行设置的简便性您可以在Github浏览器界面中完成所有操作,而无需在本地使用git或任何其他工具.)最近有一段由Serena Bonaretti使用Binder系统的介绍性视频 MyBinder主页并激活GitHub repository name or URL下左侧的下拉菜单.

You can use the public MyBinder/Binder service to launch active sessions without needing to host a website. You can set up a public repository at Github (or several other places such as GitLab) and by connecting that to the MyBinder.org service via a URL that triggers launching that repo on a remote machine, you'll be able to share your functionality with others. For example, if you go here, and click launch binder you get some active examples. (I recently helped someone with a simpler repo that launches one here, and that may give you a better idea of how easy it is to set up using the Binder system. You can do it all right in Github browser interface without needing to use git or anything locally.) There is a recent introductory video on using the Binder system by Serena Bonaretti here. The easiest way to see the options for where you can currently host your code and files is to go to the main MyBinder page and activate the drop-down menu on the left under GitHub repository name or URL.

您可以对Appmode进行相同的操作,有关在以下情况下使用Appmode的示例,请参见此处.活页夹服务.甚至可以通过Binder系统编辑custom.js文件,因此您可以隐藏edit app按钮,请参见此处.

You can do the same with Appmode, see here for an example of using Appmode with the Binder service. It is possible to even edit the custom.js file via the Binder system so you can hide the edit app button, see here.

Jupyter话语论坛是寻求有关Binder问题的更多帮助的好资源.

The Jupyter Discourse Forum is a good resource to ask for more help on Binder issues.

这篇关于Colab之上的简单UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆