Spaces:
Running
Running
mhdiqbalpradipta
commited on
Commit
•
429aa4f
1
Parent(s):
577e1b2
hapus torch
Browse fileshapus torch karena tidak dipakai
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
-
import torch
|
4 |
|
5 |
# Memuat model untuk klasifikasi makanan
|
6 |
food_classifier = pipeline(task="image-classification", model="mhdiqbalpradipta/minang_food_classification")
|
@@ -16,9 +15,6 @@ def prediksi_makanan(gambar):
|
|
16 |
|
17 |
return f"Makanan: {label_makanan}, Skor: {skor:.2f}"
|
18 |
|
19 |
-
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
20 |
-
print(f"Menggunakan perangkat: {device}")
|
21 |
-
|
22 |
# Antarmuka Gradio
|
23 |
image_in = gr.Image(type='pil')
|
24 |
label_out = "text"
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
|
|
3 |
|
4 |
# Memuat model untuk klasifikasi makanan
|
5 |
food_classifier = pipeline(task="image-classification", model="mhdiqbalpradipta/minang_food_classification")
|
|
|
15 |
|
16 |
return f"Makanan: {label_makanan}, Skor: {skor:.2f}"
|
17 |
|
|
|
|
|
|
|
18 |
# Antarmuka Gradio
|
19 |
image_in = gr.Image(type='pil')
|
20 |
label_out = "text"
|