File size: 2,122 Bytes
9717c3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e0464d7
9717c3d
 
e0464d7
 
9717c3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
title: Webapp Factory WizardCoder Transformers
emoji: πŸ­πŸ§™
colorFrom: brown
colorTo: red
sdk: docker
pinned: false
app_port: 7860
---

A minimalist Docker project to generate apps on demand.

Ready to be used in a Hugging Face Space.

# WARNING

WARNING! This is an experimental version of the "Webapp Factory" project, and it might not work properly!

# Examples

## Local prompt examples

```
http://localhost:7860/?prompt=a%20pong%20game%20clone%20in%20HTML,%20made%20using%20the%20canvas
```
```
http://localhost:7860/?prompt=a simple html canvas game where we need to feed tadpoles controlled by an AI. The tadpoles move randomly, but when the user click inside the canvas to add some kind of food, the tadpoles will compete to eat it. Tadpole who didn't eat will die, and those who ate will reproduce.
```

## Installation

### Prerequisites

**A powerful machine is required! You need at least 24 Gb of memory!**

- Install NVM: https://github.com/nvm-sh/nvm
- Install Docker https://www.docker.com

### Python

This project relies on Python dependencies called through Pythonia.

To install those dependencies, first you should create and activate a new virtual environment for Python:

```bash
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install torch
```

Note: the Dockerfile will install pytorch itself

Then install the dependencies in it:
```bash
pip install -r requirements.txt
```

### Installing the model

For this project we need to download the model in advance:

```
# go to the models directory
cd models

# Make sure you have git-lfs installed (https://git-lfs.com)
git lfs install

git clone https://huggingface.co/WizardLM/WizardCoder-15B-V1.0

cd ..
```

Note: the Dockerfile script will do this automatically

### Building and run without Docker

```bash
nvm use
npm i
npm run start
```

### Building and running with Docker

```bash
npm run docker
```

This script is a shortcut executing the following commands:

```bash
docker build -t webapp-factory-wizardcoder-transformers .
docker run -it -p 7860:7860 webapp-factory-wizardcoder-transformers
```