Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from huggingface_hub import AsyncInferenceClient
|
3 |
client = AsyncInferenceClient()
|
4 |
|
@@ -6,7 +7,7 @@ def image_classifier(inp):
|
|
6 |
class_names = ["0", "1"]
|
7 |
inp.save("why.png")
|
8 |
sunflower_path = "why.png"
|
9 |
-
r =
|
10 |
return r
|
11 |
|
12 |
|
|
|
1 |
import gradio as gr
|
2 |
+
import asyncio
|
3 |
from huggingface_hub import AsyncInferenceClient
|
4 |
client = AsyncInferenceClient()
|
5 |
|
|
|
7 |
class_names = ["0", "1"]
|
8 |
inp.save("why.png")
|
9 |
sunflower_path = "why.png"
|
10 |
+
r = asyncio.run(client.zero_shot_image_classification("why.png", labels=["mouth", "other"]))
|
11 |
return r
|
12 |
|
13 |
|