baguioni commited on
Commit
64445a4
1 Parent(s): 1ad75c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -15
app.py CHANGED
@@ -1,27 +1,27 @@
1
  import gradio as gr
2
 
3
  # Models
4
- jacobe = gr.Interface.load(f"huggingface/huggingtweets/jacobe")
5
- baguioni = gr.Interface.load(f"huggingface/huggingtweets/baguioni")
6
- elonmusk = gr.Interface.load(f"huggingface/huggingtweets/elonmusk")
7
- realdonaldtrump = gr.Interface.load(f"huggingface/huggingtweets/realdonaldtrump")
8
- barackobama = gr.Interface.load(f"huggingface/huggingtweets/barackobama")
9
- karpathy = gr.Interface.load(f"huggingface/huggingtweets/karpathy")
10
 
11
  def generated_tweet(inputtext, user):
12
  if user == 'jacobe':
13
- tweet = jacobe(inputtext)
14
  if user == 'baguioni':
15
- tweet = baguioni(inputtext)
16
  if user == 'elonmusk':
17
- tweet = jacobe(inputtext)
18
  if user == 'realdonaldtrump':
19
- tweet = donaldtrump(inputtext)
20
  if user == 'karpathy':
21
- tweet = karpathy(inputtext)
22
  if user == 'barackobama':
23
- tweet = barackobama(inputtext)
24
- return tweet
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 text",lines=5),
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,