Uploading food not food text classifier demo app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from typing import TypedDict
|
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
# Create function to use our model on given text
|
| 9 |
-
def food_not_food_classifier(text: str) ->
|
| 10 |
food_not_food_classifier = pipeline(task="text-classifcation",
|
| 11 |
# Because our model is on Hugging Face already, we can pass in the model name directly
|
| 12 |
model="mrdbourke/learn_hf_food_not_food_text_classifier-distilbert-base-uncased",
|
|
|
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
# Create function to use our model on given text
|
| 9 |
+
def food_not_food_classifier(text: str) -> dict[str, float]:
|
| 10 |
food_not_food_classifier = pipeline(task="text-classifcation",
|
| 11 |
# Because our model is on Hugging Face already, we can pass in the model name directly
|
| 12 |
model="mrdbourke/learn_hf_food_not_food_text_classifier-distilbert-base-uncased",
|