打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Funny moments of using the GitHub Copilot

Image source: GitHub

Copilot? or Co-troublemaker.Permalink

I have been invited to the GitHub + OpenAI Copilot preview in VSCode for over a week now. While I am aware that many fellow coders have raised serious concern about copyrights of GitHub cashing in open-source codes, here I will report some of my lite usage in Copilot as a computational mathematician, along with what Copilot is instituting me to write during writing this blog post.

Enable and disable the CopilotPermalink

Copilot can be enabled by simply clicking the icon in the status bar.

Then we can sit back and enjoy some auto-completions Copilot provides (or institutes us to use), for example:

The good news are me is that, anecdotally, I do not see Copilot scanning my local files in the current workspace to make suggestions (while many others have complained in the preview discussion forums…). For example, the following suggested file does not exist, but just a sequential numbering of the files I have inserted in the current document:

Once enabled, upon clicking the icon again, it shows a toggle to disable Copilot for all languages or just the language of the current file we are working on.

Alternatively, we can set up specific languages to enable and disable Copilot in setting.json:

"github.copilot.enable": {
        "*": true,
        "yaml": false,
        "plaintext": false,
        "markdown": true,
        "latex": false
    },

Python (mainly PyTorch)Permalink

The usage in Python is a pleasant surprise as I thought the intellicode is already doing a phenomenal job on autocompletion. However, Copilot is on another level, in both a good and a bad way.

Here are some examples.

Autocomplete code based on commentsPermalink

Autocomplete code based on the contextPermalink

Example 1Permalink

If Copilot is GPT-based (or Transformer-based), it seems to be totally language-specific syntax-agnostic. For example, it sometimes provides a suggestion that induces a syntax error…

Example 2Permalink

Of course, Copilot is reading the current file for possible suggestions. Some examples are as follows:

The following one is a pretty good example of the Copilot’s power in that it can suggest a function that is not in the current scope, but is in the library. BTW, visualize the spectogram is exactly I wanted to achieve.

Copilot’s suggestions when writing this sectionPermalink

What Copilot suggests me to write during writing this section for this blog post.

LaTeXPermalink

While GitHub explicitly said that Copilot is not available for LaTeX, I could not help to give a try, and it works poorly unfortunately. Poor GPT…guess Transformers still have huge limitations.

When writing papers, Copilot spills all sorts of suggestions based on the nearest paragraph. Sometimes, it is almost funny in that it just re-iterates the same word, and it is not even making sense…

Example 1Permalink

Totally not what I want to write (this sentence is suggested by Copilot after I typed “Totally not”).

Example 2Permalink

Absolute nonsense (a pretty good candidate for those fake computer generated papers though).

Copilot’s suggestions when writing this sectionPermalink

What Copilot suggests me to write during writing this section for this blog post.

SummaryPermalink

While I am not a big fan of Copilot, I do not see any reason to disable it. I am happy to see that GitHub is working on a better Copilot, and I am happy to see that I can use it to write my papers.

This was the suggestion Copilot suggested right after I typed “While”, and too bad I hit Tab too fast and forgot to snap a screenshot of this self-boasting suggestion.

What I meant to type was: while it seems that Copilot is pretty “powerful”, I can see I am only enabling it for Python, javascript, and CSS. For writing posts either in Markdown and LaTeX, the extensions Markdown all-in-one and LaTeX workshop are already doing a fantastic job on autocompleting file names, reading local directories, and other things.

Bonus: use Copilot to write a paper…Permalink

Here is a video of how to use the GitHub copilot to write a nonsensical paper…as we can see, even though content-wise Copilot is parroting, in general the Copilot gives pretty good autocomplete suggestions syntax-wise.

Bonus 2: chat with Copilot about mathematics, life, love, and the universePermalink

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
陶哲轩用大模型辅助解决数学问题:生成代码、编辑LaTeX公式都很好用
用上最新的 GitHub Copilot Chat 了!#vscode #github #copilot
jquery自动补全插件
生活口语课程:English Pod对话讲解——推荐饭馆Recommend a restaurant...
重磅!OpenAI升级Codex,直接将书面语言转为计算机代码
原罪?人工智能生成代码#GitHub Copilot遭集体起诉
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服