Ahsen Khaliq commited on
Commit
3bfdf10
1 Parent(s): 97be3c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
 
3
  title = "Reformer"
4
 
5
- description = "Gradio Demo for Reformer'. To use it, simply add your text, or click one of the examples to load them. Read more at the links below."
6
 
7
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2001.04451' target='_blank'>Reformer: The Efficient Transformer</a></p>"
8
 
@@ -12,18 +12,16 @@ examples = [
12
 
13
  reformerc = gr.Interface.load("huggingface/google/reformer-crime-and-punishment")
14
 
15
- reformere = gr.Interface.load("huggingface/google/reformer-enwik8")
16
 
17
  def inference(text,model):
18
  if model == "reformer-crime-and-punishment":
19
  outtext = reformerc(text)
20
- else:
21
- outtext = reformere(text)
22
  return outtext
23
 
24
  gr.Interface(
25
  inference,
26
- [gr.inputs.Textbox(label="Input"),gr.inputs.Dropdown(choices=["reformer-crime-and-punishment","reformer-enwik8"], type="value", default="reformer-enwik8", label="model")],
27
  gr.outputs.Textbox(label="Output"),
28
  examples=examples,
29
  article=article,
 
2
 
3
  title = "Reformer"
4
 
5
+ description = "Gradio Demo for Reformer. To use it, simply add your text, or click one of the examples to load them. Read more at the links below."
6
 
7
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2001.04451' target='_blank'>Reformer: The Efficient Transformer</a></p>"
8
 
 
12
 
13
  reformerc = gr.Interface.load("huggingface/google/reformer-crime-and-punishment")
14
 
15
+ #reformere = gr.Interface.load("huggingface/google/reformer-enwik8")
16
 
17
  def inference(text,model):
18
  if model == "reformer-crime-and-punishment":
19
  outtext = reformerc(text)
 
 
20
  return outtext
21
 
22
  gr.Interface(
23
  inference,
24
+ [gr.inputs.Textbox(label="Input"),gr.inputs.Dropdown(choices=["reformer-crime-and-punishment","reformer-enwik8"], type="value", default="reformer-crime-and-punishment", label="model")],
25
  gr.outputs.Textbox(label="Output"),
26
  examples=examples,
27
  article=article,