Uploading food not food text classifier demo app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ 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-
|
| 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",
|
| 13 |
device="cuda" if torch.cuda.is_available() else "cpu",
|
|
|
|
| 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-classification",
|
| 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",
|
| 13 |
device="cuda" if torch.cuda.is_available() else "cpu",
|