jsonformer
jsonformer copied to clipboard
Javascript version started - Help needed
This would be awesome to also have in the JS version.
My yet uncompleted attempt to translate JSONFormer into Typescript:
https://github.com/vincenzodomina/jsonformerjs
I used numjs as a lightweight alternative to tensorflow to replace torch, but Huggingface transformers is not available in JavaScript, any help with how to work with or substitute the Huggingface interface and to at least get it running with the OpenAI API would be appreciated.
Is there some reason you need to do this in JS? The models are very compute intensive and very large so they aren't really well suited to running on a web page. Why not just make calls to a backend service built in Python?
If it's just something you're doing for fun then I'm pretty sure you'll just have to implement one or more models and generation methods yourself from scratch.
Yes, I think it would open up the possibility for many to integrate it into their NodeJs backends. In my case I have a bigger project setup in NodeJs and would like to integrate it directly without the need for another API setup. But agree, the API way is a good enough workaround for now.
@vincenzodomina
Came here specifically to see if anyone has done this. I can't offer help right now, but just know that others are looking for a Node version as well. Good luck!
@vincenzodomina
Came here specifically to see if anyone has done this. I can't offer help right now, but just know that others are looking for a Node version as well. Good luck!
I ended up creating this: https://github.com/vincenzodomina/gpt-json-js
As I needed only the JSON validation part, and in my case it worked like a charm.
Especially with the new function calling feature of OpenAI it makes sense on top of.
Awesome, I was about to write my own but saw that the newer version of OpenAI has a built in schema tool similar to this. If this one better? Even their documentation mentions "it may hallucinate weird invalid json" which is disconceting.
Awesome, I was about to write my own but saw that the newer version of OpenAI has a built in schema tool similar to this. If this one better? Even their documentation mentions "it may hallucinate weird invalid json" which is disconceting.
Exactly, this is why i always run this format checker/sanitizer over the results of the function call results and it works great. But of course it depends on your use case, how complex your schemas are, etc.