andreslu commited on
Commit
0352325
·
1 Parent(s): c926a01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -1,13 +1,14 @@
1
  import gradio as gr
2
 
3
- import torch
4
 
5
- if torch.cuda.is_available():
6
- device = torch.device("cuda")
7
- print('GPU is available')
8
- else:
9
- device = torch.device("cpu")
10
- print('GPU is not available')
 
11
 
12
  def uppercase(text):
13
  return text.upper()
 
1
  import gradio as gr
2
 
3
+ from inductor import BartInductor
4
 
5
+ inductor = BartInductor()
6
+
7
+ rule = '<mask> is the capital of <mask>.'
8
+ generated_texts = inductor.generate(rule)
9
+
10
+ for text in generated_texts:
11
+ print(text)
12
 
13
  def uppercase(text):
14
  return text.upper()