Skip to content

Commit b4d9825

Browse files
authored
Website: WIP (gradio-app#328)
Ported gradio website into gradio repository, now launched as a docker service from gradio/website
1 parent 5cf1f66 commit b4d9825

File tree

216 files changed

+8437
-680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+8437
-680
lines changed

.dockerignore

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Python build
2+
.eggs/
3+
gradio.egg-info/*
4+
!gradio.egg-info/requires.txt
5+
!gradio.egg-info/PKG-INFO
6+
dist/
7+
*.pyc
8+
__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
build/
12+
13+
# JS build
14+
gradio/templates/frontend/static
15+
16+
# Secrets
17+
.env
18+
19+
# Gradio run artifacts
20+
*.db
21+
*.sqlite3
22+
gradio/launches.json
23+
24+
# Tests
25+
.coverage
26+
coverage.xml
27+
test.txt
28+
29+
# Demos
30+
demo/tmp.zip
31+
demo/flagged
32+
demo/files/*.avi
33+
demo/files/*.mp4
34+
35+
# Etc
36+
.idea/*
37+
.DS_Store
38+
*.bak
39+
workspace.code-workspace

.gitignore

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
venv
2-
dist/
1+
# Python build
32
.eggs/
43
gradio.egg-info/*
54
!gradio.egg-info/requires.txt
65
!gradio.egg-info/PKG-INFO
6+
dist/
77
*.pyc
8-
staticfiles
9-
.env
10-
.coverage
11-
coverage.xml
12-
*.sqlite3
13-
.idea/*
14-
*.ipynb
15-
.ipynb_checkpoints/*
16-
models/*
17-
.models/*
18-
gradio_files/*
19-
ngrok*
20-
examples/ngrok*
21-
gradio-flagged/*
22-
.DS_Store
238
__pycache__/
249
*.py[cod]
2510
*$py.class
26-
demo/models/*
27-
*.h5
28-
docs.json
29-
*.bak
30-
demo/tmp.zip
31-
demo/flagged
32-
test.txt
3311
build/
34-
flagged/
35-
gradio/launches.json
12+
13+
# JS build
3614
gradio/templates/frontend/static
37-
workspace.code-workspace
15+
16+
# Secrets
17+
.env
18+
19+
# Gradio run artifacts
3820
*.db
21+
*.sqlite3
22+
gradio/launches.json
23+
flagged
24+
25+
# Tests
26+
.coverage
27+
coverage.xml
28+
test.txt
29+
30+
# Demos
31+
demo/tmp.zip
3932
demo/files/*.avi
4033
demo/files/*.mp4
34+
35+
# Etc
36+
.idea/*
37+
.DS_Store
38+
*.bak
39+
workspace.code-workspace
40+
*.h5

README.md

+158-67
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tensorflow
File renamed without changes.

demo/disease_report/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fpdf

demo/disease_report.py renamed to demo/disease_report/run.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def disease_report(img, scan_for, generate_report):
3535
],
3636
title="Disease Report",
3737
description="Upload an Xray and select the diseases to scan for.",
38-
theme="compact",
38+
theme="grass",
3939
flagging_options=["good", "bad", "etc"],
4040
allow_flagging="auto"
4141
)

demo/face_segment.py

-39
This file was deleted.

demo/files/timeseries.csv

-27
This file was deleted.

demo/files/video.avi

-810 KB
Binary file not shown.

demo/files/video.mp4

-1.5 MB
Binary file not shown.
File renamed without changes.

demo/form_graph/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
matplotlib
File renamed without changes.

demo/fraud_detector/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pandas
File renamed without changes.

demo/generate_tone/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
numpy
File renamed without changes.

demo/gpt_j/run.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import gradio as gr
2+
3+
title = "GPT-J-6B"
4+
5+
examples = [
6+
['The tower is 324 metres (1,063 ft) tall,'],
7+
["The Moon's orbit around Earth has"],
8+
["The smooth Borealis basin in the Northern Hemisphere covers 40%"]
9+
]
10+
11+
gr.Interface.load("huggingface/EleutherAI/gpt-j-6B",
12+
inputs=gr.inputs.Textbox(lines=5, label="Input Text"),
13+
title=title, examples=examples).launch();
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

demo/image_classifier.py

-31
This file was deleted.
File renamed without changes.
File renamed without changes.
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
numpy
2+
tensorflow

demo/image_classifier/run.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import gradio as gr
2+
import tensorflow as tf
3+
import requests
4+
5+
inception_net = tf.keras.applications.MobileNetV2() # load the model
6+
7+
# Download human-readable labels for ImageNet.
8+
response = requests.get("https://git.io/JJkYN")
9+
labels = response.text.split("\n")
10+
11+
def classify_image(inp):
12+
inp = inp.reshape((-1, 224, 224, 3))
13+
inp = tf.keras.applications.mobilenet_v2.preprocess_input(inp)
14+
prediction = inception_net.predict(inp).flatten()
15+
return {labels[i]: float(prediction[i]) for i in range(1000)}
16+
17+
image = gr.inputs.Image(shape=(224, 224))
18+
label = gr.outputs.Label(num_top_classes=3)
19+
20+
gr.Interface(fn=classify_image, inputs=image, outputs=label).launch()

0 commit comments

Comments
 (0)