OzoneAsai commited on
Commit
92fb861
1 Parent(s): 5854eca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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
- # Gradioでモデルを常時ロードするためのコード
 
8
  import gradio as gr
9
 
10
- # モデルの読み込みと起動
11
- gr.Interface(fn=pipe, live=True).launch()
 
 
 
 
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()