miwojc commited on
Commit
173b58d
·
1 Parent(s): 038fa25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -13
app.py CHANGED
@@ -1,13 +1,9 @@
1
- import json
2
-
3
- import requests
4
-
5
- API_URL = "https://api-inference.huggingface.co/models/gpt2"
6
- headers = {}
7
-
8
- def query(payload):
9
- data = json.dumps(payload)
10
- response = requests.request("POST", API_URL, headers=headers, data=data)
11
- return json.loads(response.content.decode("utf-8"))
12
-
13
- data = query("Can you please let us know more details about your ")
 
1
+ import gradio as gr
2
+ title = "papuGaPT2 Demo"
3
+ description = "Demo for polish GPT2 for text generation. To use it, simply add your text, or click one of the examples to load them."
4
+ examples = [
5
+ ['Dialogi niedobre… Bardzo niedobre dialogi są. W ogóle brak akcji jest. Nic się nie dzieje.'],
6
+ ["Na przykład w jednym sklepie na półkach po rocznym leżeniu cukier ma 80 proc. cukru w cukrze,"],
7
+ ["Moja jest tylko racja i to święta racja. Bo nawet jak jest twoja,"]
8
+ ]
9
+ gr.Interface.load("huggingface/flax-community/papuGaPT2", inputs=gr.inputs.Textbox(lines=5, label="Input Text"),title=title,description=description, examples=examples).launch()