Spaces:
Runtime error
Runtime error
mhdiqbalpradipta
commited on
Commit
•
c6c3058
1
Parent(s):
3aa447c
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
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")
|
@@ -23,4 +24,11 @@ contoh_gambar = ['ayam_goreng.jpg', 'ayam_pop.jpg', 'daging_rendang.jpg', 'dende
|
|
23 |
intf = gr.Interface(fn=prediksi_makanan, inputs=image_in, outputs=label_out, examples=contoh_gambar, title="Pengklasifikasi Makanan Minang", description="Unggah gambar makanan untuk mengklasifikasikannya menjadi hidangan Minang.")
|
24 |
|
25 |
# if __name__ == "__main__":
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
+
from fastapi import FastAPI
|
4 |
|
5 |
# Memuat model untuk klasifikasi makanan
|
6 |
food_classifier = pipeline(task="image-classification", model="mhdiqbalpradipta/minang_food_classification")
|
|
|
24 |
intf = gr.Interface(fn=prediksi_makanan, inputs=image_in, outputs=label_out, examples=contoh_gambar, title="Pengklasifikasi Makanan Minang", description="Unggah gambar makanan untuk mengklasifikasikannya menjadi hidangan Minang.")
|
25 |
|
26 |
# if __name__ == "__main__":
|
27 |
+
app = FastAPI()
|
28 |
+
|
29 |
+
@app.get('/')
|
30 |
+
async def root():
|
31 |
+
return 'Gradio app is running at /gradio', 200
|
32 |
+
|
33 |
+
app = gr.mount_gradio_app(app, intf, path='/gradio')
|
34 |
+
# intf.launch(share=False)
|