Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
#
|
2 |
-
from transformers import pipeline
|
3 |
-
|
4 |
-
# モデルの事前読み込み
|
5 |
-
pipe = pipeline("image-classification", model="sanali209/imclasif-quality-v001")
|
6 |
|
7 |
-
#
|
|
|
8 |
import gradio as gr
|
9 |
|
10 |
-
#
|
11 |
-
|
|
|
|
|
|
|
|
1 |
+
# モデルの常時ロードとGradioの使用例
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
# 必要なライブラリをインポート
|
4 |
+
from transformers import pipeline
|
5 |
import gradio as gr
|
6 |
|
7 |
+
# 画像分類のためのパイプラインを定義
|
8 |
+
image_classification_pipe = pipeline("image-classification", model="sanali209/imclasif-quality-v001")
|
9 |
+
|
10 |
+
# Gradioによるモデルのロードと起動
|
11 |
+
gr.Interface(fn=image_classification_pipe, inputs="image", outputs="label").launch()
|