Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
# Models
|
4 |
-
jacobe = gr.Interface.load(
|
5 |
-
baguioni = gr.Interface.load(
|
6 |
-
elonmusk = gr.Interface.load(
|
7 |
-
realdonaldtrump = gr.Interface.load(
|
8 |
-
barackobama = gr.Interface.load(
|
9 |
-
karpathy = gr.Interface.load(
|
10 |
|
11 |
def generated_tweet(inputtext, user):
|
12 |
if user == 'jacobe':
|
13 |
-
|
14 |
if user == 'baguioni':
|
15 |
-
|
16 |
if user == 'elonmusk':
|
17 |
-
|
18 |
if user == 'realdonaldtrump':
|
19 |
-
|
20 |
if user == 'karpathy':
|
21 |
-
|
22 |
if user == 'barackobama':
|
23 |
-
|
24 |
-
|
25 |
|
26 |
title = "GPT-2 Tweet Generator"
|
27 |
|
@@ -38,8 +38,7 @@ examples = [
|
|
38 |
|
39 |
gr.Interface(
|
40 |
generated_tweet,
|
41 |
-
[gr.inputs.Textbox(label="Input
|
42 |
-
gr.inputs.Dropdown(choices=["baguioni","jacobe", "elonmusk", "realdonaldtrump"], type="value", default="baguioni", label="user")],
|
43 |
[gr.outputs.Label(label="Output")],
|
44 |
examples=examples,
|
45 |
article=article,
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
# Models
|
4 |
+
jacobe = gr.Interface.load("huggingface/huggingtweets/jacobe")
|
5 |
+
baguioni = gr.Interface.load("huggingface/huggingtweets/baguioni")
|
6 |
+
elonmusk = gr.Interface.load("huggingface/huggingtweets/elonmusk")
|
7 |
+
realdonaldtrump = gr.Interface.load("huggingface/huggingtweets/realdonaldtrump")
|
8 |
+
barackobama = gr.Interface.load("huggingface/huggingtweets/barackobama")
|
9 |
+
karpathy = gr.Interface.load("huggingface/huggingtweets/karpathy")
|
10 |
|
11 |
def generated_tweet(inputtext, user):
|
12 |
if user == 'jacobe':
|
13 |
+
return jacobe(inputtext)
|
14 |
if user == 'baguioni':
|
15 |
+
return baguioni(inputtext)
|
16 |
if user == 'elonmusk':
|
17 |
+
return jacobe(inputtext)
|
18 |
if user == 'realdonaldtrump':
|
19 |
+
return donaldtrump(inputtext)
|
20 |
if user == 'karpathy':
|
21 |
+
return karpathy(inputtext)
|
22 |
if user == 'barackobama':
|
23 |
+
return barackobama(inputtext)
|
24 |
+
|
25 |
|
26 |
title = "GPT-2 Tweet Generator"
|
27 |
|
|
|
38 |
|
39 |
gr.Interface(
|
40 |
generated_tweet,
|
41 |
+
[gr.inputs.Textbox(label="Input",lines=5), gr.inputs.Dropdown(choices=["baguioni","jacobe", "elonmusk", "realdonaldtrump", "barackobama", "karpathy"], type="value", default="baguioni", label="user")],
|
|
|
42 |
[gr.outputs.Label(label="Output")],
|
43 |
examples=examples,
|
44 |
article=article,
|