Spaces:
Sleeping
Sleeping
un-index
commited on
Commit
•
5e3b1a8
1
Parent(s):
0cc2838
- .gitattributes +27 -0
- app.py +23 -23
.gitattributes
CHANGED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -1,36 +1,36 @@
|
|
1 |
|
2 |
import gradio as gr
|
3 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
|
5 |
|
6 |
-
# prompt = "In a shocking finding, scientists discovered a herd of unicorns living in a remote, " \
|
7 |
-
# "previously unexplored valley, in the Andes Mountains. Even more surprising to the " \
|
8 |
-
# "researchers was the fact that the unicorns spoke perfect English."
|
9 |
|
10 |
|
11 |
-
def predict(text):
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
|
20 |
-
iface = gr.Interface(fn=predict, inputs="text", outputs="text")
|
21 |
-
iface.launch()
|
22 |
|
23 |
# all below works but testing
|
24 |
-
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
1 |
|
2 |
import gradio as gr
|
3 |
+
# # from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
|
5 |
|
6 |
+
# # prompt = "In a shocking finding, scientists discovered a herd of unicorns living in a remote, " \
|
7 |
+
# # "previously unexplored valley, in the Andes Mountains. Even more surprising to the " \
|
8 |
+
# # "researchers was the fact that the unicorns spoke perfect English."
|
9 |
|
10 |
|
11 |
+
# def predict(text):
|
12 |
|
13 |
+
# tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-j-6B")
|
14 |
+
# model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-j-6B")
|
15 |
+
# input_ids = tokenizer(text, return_tensors="pt").input_ids
|
16 |
+
# gen_tokens = model.generate(input_ids, do_sample=True, temperature=0.9, max_length=100)
|
17 |
+
# gen_text = tokenizer.batch_decode(gen_tokens)[0]
|
18 |
+
# return gen_text
|
19 |
|
20 |
+
# iface = gr.Interface(fn=predict, inputs="text", outputs="text")
|
21 |
+
# iface.launch()
|
22 |
|
23 |
# all below works but testing
|
24 |
+
import gradio as gr
|
25 |
|
26 |
+
title = "GPT-J-6B"
|
27 |
|
28 |
+
examples = [
|
29 |
+
['The tower is 324 metres (1,063 ft) tall,'],
|
30 |
+
["The Moon's orbit around Earth has"],
|
31 |
+
["The smooth Borealis basin in the Northern Hemisphere covers 40%"]
|
32 |
+
]
|
33 |
|
34 |
+
gr.Interface.load("huggingface/EleutherAI/gpt-j-6B",
|
35 |
+
inputs=gr.inputs.Textbox(lines=10, label="Input Text"),
|
36 |
+
title=title, examples=examples).launch();
|