rjohansyah commited on
Commit
3875bee
0 Parent(s):

First commit

Browse files
Files changed (7) hide show
  1. .gitignore +0 -0
  2. .gitmodules +3 -0
  3. README.md +7 -0
  4. app.py +16 -0
  5. datasets +1 -0
  6. requirements.txt +2 -0
  7. taskfile.yaml +19 -0
.gitignore ADDED
File without changes
.gitmodules ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [submodule "datasets"]
2
+ path = datasets
3
+ url = ./datasets
README.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Model - SLNSW Text Summary
2
+
3
+ ## Setup
4
+ ```
5
+ git clone git@git.kororo.net:generaptor/model-slnsw-text-summary.git
6
+
7
+ ```
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
5
+
6
+ def predict(image):
7
+ predictions = pipeline(image)
8
+ return {p["label"]: p["score"] for p in predictions}
9
+
10
+ gr.Interface(
11
+ predict,
12
+ inputs=gr.inputs.Image(label="Upload hot dog candidate", type="filepath"),
13
+ outputs=gr.outputs.Label(num_top_classes=2),
14
+ title="Hot Dog? Or Not?",
15
+ allow_flagging="manual"
16
+ ).launch()
datasets ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 020a887898859f9df574456e0a604aa9df09d97f
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ transformers
2
+ torch
taskfile.yaml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3"
2
+ env:
3
+ NAME: "slnsw-text-summary"
4
+ tasks:
5
+ setup-hf:
6
+ cmds:
7
+ - huggingface-cli repo create --type model -y $NAME
8
+ - huggingface-cli repo create --type space --space_sdk gradio -y $NAME
9
+ - huggingface-cli repo create --type dataset -y $NAME
10
+ setup-git:
11
+ cmds:
12
+ - git remote add hf-model https://huggingface.co/generaptor/$NAME
13
+ - git remote add hf-space https://huggingface.co/spaces/generaptor/$NAME
14
+ - git clone https://huggingface.co/datasets/generaptor/$NAME datasets
15
+ - git submodule add ./datasets hf-datasets
16
+ setup:
17
+ cmds:
18
+ - task: "setup-hf"
19
+ - task: "setup-git"