sundea commited on
Commit
ccf05cd
·
1 Parent(s): f6555cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -105,7 +105,11 @@ def greet(text):
105
  x = import_module('models.' + model_name)
106
 
107
  config = x.Config(dataset, embedding)
108
- device = 'cpu'
 
 
 
 
109
  model = models.TextCNN.Model(config)
110
 
111
  # vocab, train_data, dev_data, test_data = build_dataset(config, args.word)
 
105
  x = import_module('models.' + model_name)
106
 
107
  config = x.Config(dataset, embedding)
108
+ device=(
109
+ "cuda"
110
+ if torch.cuda.is_available()
111
+ else "cpu"
112
+ )
113
  model = models.TextCNN.Model(config)
114
 
115
  # vocab, train_data, dev_data, test_data = build_dataset(config, args.word)