Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,16 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
|
| 4 |
### https://huggingface.co/blog/fine-tune-vit -->> the blog post how to fine tune ViT
|
| 5 |
|
| 6 |
-
examples = ["example-leaf.jpeg"]
|
| 7 |
|
| 8 |
-
iface = gr.Interface("huggingface/nateraw/vit-base-beans",
|
| 9 |
-
inputs="image",
|
| 10 |
-
examples=examples,
|
| 11 |
-
outputs=gr.outputs.Label(num_top_classes=5, label='Prediction'))
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
|
| 5 |
### https://huggingface.co/blog/fine-tune-vit -->> the blog post how to fine tune ViT
|
| 6 |
|
|
|
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
pipe = pipeline(task="image-classification",
|
| 10 |
+
model="nateraw/vit-base-beans")
|
| 11 |
+
|
| 12 |
+
gr.Interface.from_pipeline(pipe,
|
| 13 |
+
title="Image Classification",
|
| 14 |
+
description="Test",
|
| 15 |
+
examples=["example-leaf.jpeg"],
|
| 16 |
+
).launch()
|