aliabd HF staff commited on
Commit
6e44867
1 Parent(s): c5ffb31

Upload with huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +6 -6
  2. app.py +14 -0
README.md CHANGED
@@ -1,12 +1,12 @@
 
1
  ---
2
- title: Gpt J Unified
3
- emoji: 🌍
4
- colorFrom: red
5
- colorTo: yellow
6
  sdk: gradio
7
  sdk_version: 3.3.1
 
8
  app_file: app.py
9
  pinned: false
10
  ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+
2
  ---
3
+ title: gpt_j_unified
4
+ emoji: 🔥
5
+ colorFrom: indigo
6
+ colorTo: indigo
7
  sdk: gradio
8
  sdk_version: 3.3.1
9
+
10
  app_file: app.py
11
  pinned: false
12
  ---
 
 
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ component = gr.Textbox(lines=5, label="Text")
4
+ api = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
5
+
6
+ demo = gr.Interface(
7
+ fn=lambda x: x[:-50] + api(x[-50:]),
8
+ inputs=component,
9
+ outputs=component,
10
+ title="GPT-J-6B",
11
+ )
12
+
13
+ if __name__ == "__main__":
14
+ demo.launch()