如何回应Kaggle中的CLI提示?
我正在使用Kaggle生成具有GPT-2的诗歌样本。我的笔记本使用来自并使用 nshepperd的gpt-2模型。
这一切都可以很好地与我的笔记本生成无条件样品。
!python src/generate_unconditional_samples.py --top_k 40 --nsamples 1 --temperature 0.9 --model_name=1.5b-model --length=300
但是,我想生成“交互式条件”方法的样本:
!python src/interactive_conditional_samples.py --top_k 40 --nsamples 10 --temperature 0.9 --model_name=1.5b-model --length=300
问题是当它请求“模型提示” 时,我无法输入提示。
当我在Kaggle的CLI中输入提示时,它不起作用。
如果我使用自己的计算能力在桌面上运行此功能,它将自动允许我输入文本以响应提示。
有没有办法在Kaggle中输入提示?
我尝试使用标志自动响应,例如您将如何使用-y自动接受是是的/安装中没有提示,但是到目前为止尚未工作。
I'm using Kaggle to generate poetry samples with GPT-2. My notebook uses datasets from Gwern's poetry generator and uses nshepperd's GPT-2 model.
This all works fine with my notebook when generating unconditional samples.
!python src/generate_unconditional_samples.py --top_k 40 --nsamples 1 --temperature 0.9 --model_name=1.5b-model --length=300
However, I want to generate samples with the "interactive conditional" method:
!python src/interactive_conditional_samples.py --top_k 40 --nsamples 10 --temperature 0.9 --model_name=1.5b-model --length=300
The problem is when it requests a "model prompt" and I have no way of entering a prompt.
It doesn't work when I enter a prompt in Kaggle's CLI.
If I were to run this on my desktop using my own computing power it would automatically allow me to enter text in response to the prompt.
Is there a way for me to enter a prompt in kaggle?
I've tried to auto respond using flags, like how you would use -y to auto accept a yes/no prompt in installs, but it hasn't worked so far.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,您必须创建一个存储所需输入的文件。
注意您的工作目录可能只读,因此您可能必须写入Kaggle目录。
接下来,运行命令,将文件作为输入
提供一个简单的方法是
在命令之前添加。喜欢
输入“是”作为对“ apt-get Update”的响应。
To do this, you have to create a file that stores the input you want.
Note that your working directory might be read-only, so you might have to write to the kaggle directory instead.
Next, run your command, giving the file as input
A simpler method would be to add
before your command. Like
to input "yes" as a response to "apt-get update".