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 · 1 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.
If you have time in your hand, try following this and see if it suits your needs: https://www.youtube.com/watch?v=8VyGlSKsYeo

I honestly think that $10/month is more than worth it. I found that having copilot is cheaper than hiring a junior dev. I mostly use it for C++, python, and TypeScript and has been really satisfied with it.

giobox
In what circumstance does Copilot allow you to not hire a junior dev? I like Copilot and find value in it at 10 dollars a month, but that's a dubious claim IMO. What Copilot does only really assists a human operator, and not in a way that meaningfully would allow anyone to reduce headcount. It's a great tool to save some round trips to google for syntax or configuration questions etc, it's unlikely to replace a person (yet...).
muzani
I used OpenAI Codex for some recent freelance work. The work was simple - upload a form in JS. When I took the job, I said I'd charge for about 4 hours of work, and they said great, they needed it tomorrow anyway. I realized I needed some help and picked up Codex.

Scope of work for the AI: import jQuery, turn the dummy code into an ajax GET call, pass the clicked data between two pages, turn a PHP form into a JS one, add form validation, setup a POST call, debugging the regex of the phone validation from their backend team.

My scope of work: steal code from Codepen to do some drag and drop file upload and mess with the CSS to have it fit the page.

I actually train JS bootcamps and I'm sure 80% of juniors cannot do this within 4 hours. Nor would the good ones be hireable within such a short timeframe.

But it did help me keep the contract within the time I'm charging for. It was a $125 contract, so it would have been worth the price if it did half the work.

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

agluszak
I can say that it works very well with Rust
alexott
Go worked quite well…
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.
~ yaj@
;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.