dennisjooo commited on
Commit
9d137af
β€’
1 Parent(s): f648847

Removed `torch.cuda.isavailable()` from `app.py`

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1,11 +1,10 @@
1
  # Importing some modules
2
  import gradio as gr
3
  from transformers import pipeline
4
- import torch
5
 
6
  # Loading in the model
7
- MODEL_AGE = pipeline('image-classification', model='nateraw/vit-age-classifier', device=0 if torch.cuda.is_available() else -1)
8
- MODEL_EMOTION = pipeline('image-classification', model='dennisjooo/emotion_classification', device=0 if torch.cuda.is_available() else -1)
9
 
10
  def classify_image(image, top_k):
11
  # Getting the classification result
 
1
  # Importing some modules
2
  import gradio as gr
3
  from transformers import pipeline
 
4
 
5
  # Loading in the model
6
+ MODEL_AGE = pipeline('image-classification', model='nateraw/vit-age-classifier', device=-1)
7
+ MODEL_EMOTION = pipeline('image-classification', model='dennisjooo/emotion_classification', device=-1)
8
 
9
  def classify_image(image, top_k):
10
  # Getting the classification result