HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
Build your own CoPilot with CodeGen AI | Natural Language to Python Code

1littlecoder · Youtube · 73 HN points · 0 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention 1littlecoder's video "Build your own CoPilot with CodeGen AI | Natural Language to Python Code".
Youtube Summary
Use this AI model to generate your Python code with natural language. You can use this to create your own open source Github Pilot companion.

Code - https://github.com/amrrs/python-codegen-ai

Model - https://huggingface.co/Salesforce/codegen-350M-mono

#copilot #aicode #python
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Jun 30, 2022 · 73 points, 18 comments · submitted by amrrs
zora_goron
I implemented a "mini" version of Copilot using EleutherAl GPT-Neo-2.7B and HuggingFace model hub and wrote a wrapper to use in emacs -- https://github.com/samrawal/emacs-secondmate

It's much more rudimentary compared to Copilot, but it's fun to play around with, and it can be run completely locally (after the model is downloaded). Plus it runs using a simple Flask local server, so it can be easily extended to other text editors.

bigChris
Copilot works well for human readable languages languages like python; JavaScript(web framework)

If I start coding in Haskell, C and Objective-c to hack my iPhone. Guess what. Copilot stops helping or just recommends the same arbitrary genetic ideas I can google myself.

For python and JavaScript? It seems to do really well at predicting the next function and ideas.

capableweb
Surprisingly, Copilot worked well with Clojure when I tried it. I don't know if it's because most lisps are very similar, so it borrows a lot of code from other languages while just changing the variable names, but seemed to have worked fine.

More advanced ideas obviously resulted in trash code or sometimes slightly broken one, but for simple stuff and boilerplate editing, it did well.

eurasiantiger
Just like having the copilot fly the plane ;)
picozeta
Could it be that it just hadn't seen enough (Haskell) training data. The amount of code in it is tiny compared to Python, JavaScript and Java.

So even the AI struggles to learn it. :p

alexott
Go worked quite well…
agluszak
I can say that it works very well with Rust
kache_
it's over for esoteric functional programming languages
petercooper
It's good, but as a Rubyist, I find it generally picks the most common solution to problems rather than the best one. Get it to tally the contents of a hash, for example, and it doesn't reach for Hash#tally at all, but the long "manual" way of doing it. So it makes me wonder if I'm encountering a Gell-Mann type effect with languages I'm less familiar with..
shreyshnaccount
I've noticed this too, but working with pandas and python for data related things. it almost always produces non-optimal code that is surprisingly popular- just the other day it wanted to make a copy of a large file instead of a view. turns out a lot of beginner courses don't teach about copy vs view because they use small toy datasets and its not a problem. also, this throws a warning too!
enijkamp
For our >350M models, here is an example of how to load these within Colab:

https://colab.research.google.com/drive/11YU00W-JLNXn-3YckJG...

This little hack will force tensor alloc on GPU instead of CPU mem.

amrrs
Wow this is amazing. Sorry for a dumb question, will it work any such LLMs or only in Codegen's case?
arriu
It seems people are frustrated with GitHub’s CoPilot pricing model
shreyshnaccount
someone should really train a model on function documentation - > AST. seems like this could help it produce better code (maybe not as readable) and stop it from regurgitating things like licences. why do i have a nagging feeling that these models + a lot of good functional programming code would be absolutely lovely
midislack
Isn't Salesforce the company that tried to assassinate Stallman?
ubertaco
As someone who has worked at Salesforce (and is on the way out): no thanks.

Salesforce is _explicitly_ geared towards vendor lock-in -- it's their bread and butter. It's why they have a vendor-specific clone of React (Lightning Web Components), a bad vendor-specific clone of Java (Apex), a bad vendor-specific clone of SQL, and a faux-development ecosystem that requires you to use their bespoke custom tools and their bespoke custom languages and frameworks. They talk about "the Salesforce economy", about how they "create jobs" for people who...build stuff in those Salesforce-specific DSLs.

Meanwhile, their entire sales department hard-sells people on "just put your data all into Salesforce and you can run your entire company through Salesforce!" Every piece of tech they build is part of something that resembles a cross between a marketing funnel and a sucking black hole.

Those proprietary "platform" components are not about extensibility so that you can "do more with your data" or whatever; it's about injecting the Salesforce parasite so deeply into all aspects of your company's operations that it's _darn near impossible_ to extricate any piece of it again.

They've even built a crappy clone of Jira that they force employees to use internally, because they apply that same philosophy internally.

People talk about Microsoft's "Embrace, Extend, Extinguish", but Salesforce has never bothered to at least put effort into the "Embrace" or "Extend" parts of that formula -- theirs is more along the lines of "Intertwine, Integrate, Incarcerate".

The last thing I'm ever gonna do is feed any of my source code into something they've built.

tmabraham
I don't think you understand what is going here...

None of your data is going to Salesforce.

All this video is showing is how to download and use an already trained model by the Salesforce Research team...

thorum
> The last thing I'm ever gonna do is feed any of my source code into something they've built.

These are open source AI models which can be downloaded and used without requiring your source code to interact with Salesforce the company in any way:

https://huggingface.co/Salesforce

Unlike GitHub Copilot which uses OpenAI’s proprietary model and can only be used through a private API.

HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ [email protected]
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.