I downloaded all files. And all of them are just a randomly answers in JSON format. So, I want to train my own tensorflow.js model using this database! But, I don't have a question database here. So, what I need to do? I want to train my model to have an offline version of GPT-2, because I didn't find a already pre-trained model of it!
And yes, I want use JavaScript in Tensorflow.JS library. So for note, here's ones of the files that I was downloaded using the download_dataset.py script: xl-1542M-k40.valid.jsonl, xl 1542M.test.jsonl, xl-1542M.train.jsonl, xl-1542M.valid.jsonl
I was using this repo: https://github.com/openai/gpt-2-output-dataset
Related
I am working on a webapp(written with react-js) that generates a Latex code which contains information to give to the user. My goal is to let the user download the PDF file directly from my application.
I first tried using this library: texlive.js, that seemed to work but really it's impossible to recompile(their "Makefile" is not meant to handle new packages) if you try to add new packages(only some basic ones work).
So I thought about using the overleaf APIs but they don't let you obtain the pdf without sending the user to their website.
Any advice to make one of them work or any other way to achieve my goal?
You can install your package in texlive.js without using MakeFile
Sorry I am not expert in answering but here is how i made it work
I wanted to implement exam paper generation using javascript
Required Package/Class : exam
I created "\texlive.js\texlive\texmf-dist\tex\latex\exam\exam.cls"
Added this to
"\texlive.js\texlive\texmf-dist\ls-R"
./tex/latex/exam:
exam.cls
And Then \texlive.js\texlive.lst
/texmf-dist/tex/latex/exam/.
And
/texmf-dist/tex/latex/exam/exam.cls
I've recently found this project:
https://github.com/SwiftLaTeX/SwiftLaTeX
I've tested it with a few documents and it seems to work. It downloads the needed packages from the web, see available packages: https://www.ctan.org/. I haven't gone deeper into passing images to the engine but it should be possible. See the official demo: https://www.swiftlatex.com/#demo
Here is the official guide with the download link for the already compiled wasm files and with the js bindings: https://www.swiftlatex.com/#install
I'm new to tensorflow and I have one question, My project has two majors part, first written in NodeJs that train my model from dataset and save model to local storage, so I have two files:
model.json
wights.bin
The second part is written in c++, After couple of days I could build tensorflow with bazel and add it to my OpenCv project, so here is my question :
I want to train my model in NodeJs part and use these models in my C++ part. Is this possible ?
also I saw tjs converter but it converts models to use in NodeJs not vice versa.
Update :
After searching a lot I figured out that I should convert my models to protobuff file, but tfjs-Converter does not support this type of conversion and another point is that I want to use my model with opencv library.
Update 2
Finally I could change my model to .pb file, first I use tfjs_converter to convert to keras model(.h5 file) and after that use this python script to convert to .pb file and opencv can successfully load model. But I got this error in using model :
libc++abi.dylib: terminating with uncaught exception of type
cv::Exception: OpenCV(4.1.0)
/tmp/opencv-20190505-12101-14vk1fh/opencv-4.1.0/modules/dnn/src/dnn.cpp:524:
error: (-2:Unspecified error) Can't create layer
"flatten_Flatten1/Shape" of type "Shape" in function
'getLayerInstance'
Any help ?
thanks
Finally i solved my own problem.
Here is the steps that I've done :
Convert my tfjs model to keras model using tfjs-converter
Using this python scripts to change keras(.h5) model to frozen model(.pb)
Use this tutorial to optimize my .pb model
Finally everything works great!
Intro
Hi, I was looking for answer in the whole Internet (in some way I kind of feel that I know every question in Stack Overflow), but the answers were never appropriate to what I'm looking for. I was trying to avoid posting question here, but situation forced me to do this.
Sorry if the answer is simpler than I think.
I'm in the middle of building my first app in Electron using JavaScript. I think that I should describe it in few words, so flam:ngo™ (which is projects name) should work like this:
User will upload two files:
file with tables (like XLSX or DOC)
file with data and blank spaces (which will be used as a template)
App will import from tables.
Now app should let user choose which rows he's interested in and where in uploaded file he wants them to be placed.
flam:ngo save document in PDF (or DOC).
Clue
Right now I need solutions just for myself and in little simpler form. For now I need flam:ngo just to work with one specify XLSX and with one DOC template, but I stuck. I know which rows in document I will always need, but I don't know what should I write to specify in JS's code that I need exactly this ones (like hey, app, pick only this one, this one and maybe this one) while JS is reading file and I don't know how to create new DOC (or PDF) file, how to write data in specified blank spaces and then at the end: how to save it in direction which I should choose for every time I'm using an app - everything in one, maybe two, processes.
Ending
Could you, please, help me: for now I have implemented file uploader which is importing file in XLSX and which is saving it as CSV, XML oraz HTML. What should I do to keep moving forward?
I really appreciate your help!
PS. For better explanation:
For now this should look like this:
1. "template.docx" is uploaded in the core
2. user uploads .xlsx
3. app reads tables and select rows chosen in code
4. app puts data from chosen rows in specify places
5. app saves file > new life of the app :)
Ok, so it's been a while and app has been already written by me. Maybe this will help someone in the future:
Solution
Packages that helps me with this issue was:
js-xlsx which converts my file to simple HTML file, where cells from my XLSX template file have always the same ID (which was important for me to work with document templates).
officegen which helps me write brand new document based on earlier prepared template.
Rest of it was just Vanilla JS.
New to the community so please don't be hard on me!
I have the following two questions:
Question 1:
I am trying to create a single page application that allows users to upload a photo (in any format) or video (also in any format). The issue(?) I'm facing is that we must use two different hosting services -- Google WS for photos and Vzaar for video.
Is it possible to create ONE form that allows the user to upload a file of their choice (video/photo) while they fill out fields that belong to that video?
Question 2:
We are using the MEAN stack for this application. Do we need to use iframes in order to get this to work properly across all platforms?
Thanks.
I will only refer to the first question here:
Since have tagged the post with "angular", I guess you use angular as the SPA-Framework. In angular you can easily create something like you asked for. You would create a controller that shows/hides fields that are needed for the current mask (video/photo) and for example dropzone.js could handle the upload of the object (video/photo) to the specified location with the given URL and accountdata. The main problem is the handling of the different locations where you store your data but this could easily handled by the angular controller.
I'm working on a small project where I'm going to read some parameters from a SQLite database. The data is generated from a Linux server running a C code. I then want to create a script using JavaScript to fetch the data from the database. I've tried with alasql.js but it takes very long time (~1 minute) before I get the list with the parameters from two tables.
SELECT sensors.id, sensors.sensorname, sensors.sensornumber, information.sensorvalue, information.timestamp FROM sensors INNER JOIN information ON sensors.id=information.sensorid
I've been reading about IndexedDB but seems like it only works with JavaScript but not with C-code. Please, correct me if I'm wrong. The clue here is that I want a database that supports writing to database from C-code and reading from database from JavaScript. The database can be read either from file:// schema or an IP address.
Would appreciate any help regarding this problem. Thanks!
Unfortunately, SQLite internal file format is complicated to fast parsing with JavaScript. One of the reasons, that the only browser side library which can read it is SQL.js and it is relatively slow, because it can not read data by selected pages from the database file, but only the whole file.
One of the options: you can switch from SQLite format to CSV or TSV plain tet formats, which can be eaily and quickly send to the browser and be parsed with jQuery.CSV, PapaParse, AlaSQL or any other CSV parsing libraries, like:
alasql('SELECT * FROM TSV("mydata.txt",{headers:true})',[],function(data){
// data
});
Another alternative: you can write simple server on node.js with native support of SQLite and then provide requested records in JSON format with ajax to your application (like in this article)