Spaces:
Runtime error
Runtime error
Commit
·
9d137af
1
Parent(s):
f648847
Removed `torch.cuda.isavailable()` from `app.py`
Browse files
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
|
| 8 |
-
MODEL_EMOTION = pipeline('image-classification', model='dennisjooo/emotion_classification', device
|
| 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
|