Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/urish/nn-function-generator
Experimenting with automatic generation of TS function bodies using ANN models
https://github.com/urish/nn-function-generator
bigquery tensorflow tsquery typescript
Last synced: 2 days ago
JSON representation
Experimenting with automatic generation of TS function bodies using ANN models
- Host: GitHub
- URL: https://github.com/urish/nn-function-generator
- Owner: urish
- Created: 2019-01-10T22:07:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-10T11:54:59.000Z (over 3 years ago)
- Last Synced: 2024-05-10T03:43:32.195Z (6 months ago)
- Topics: bigquery, tensorflow, tsquery, typescript
- Language: TypeScript
- Homepage: https://nn-functions-playground-myeqrox3aa-uc.a.run.app/
- Size: 180 KB
- Stars: 8
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nn-function-generator
Experimenting with automatic generation of TS function bodies using ANN models
## Setup
1. Download `typescript-all-functions.json.gz` and put it inside the `data` directory
2. Run `yarn dataset` to prepare the dataset for training
3. Run `cd model && python train.py` to train the model## Running the playground
1. Run `cd model && python test-server.py --run run_001`
2. Run `yarn start`
3. Go to `http://localhost:3003/` and have fun!Alternatively, you can use docker and generate an image for the playground app using the
provided [Dockerfile](Dockerfile):```bash
docker build -t nn-function-gen .
docker -it -v /path/to/dataset:/app/data -v /path/to/model/runs:/app/runs -p 3003:3003 run nn-function-gen
```Remember to replace `/path/to/dataset` and `/path/to/model/runs` with the appropriate paths for your machine. The image is configured to load the model from the first run (`run_001`) by default.
After starting the container, you can go to [http://localhost:3003](http://localhost:3003/) to launch the playground.
## Training on Google Cloud TPU
```
ctpu up -preemptible -machine-type n1-highmem-16
virtualenv ngvikings
source ngvikings/bin/activate
cd model
pip install -r requirements.txt
python train.py --tpu
```