Instructions to use dariadaria/reviews_classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dariadaria/reviews_classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="dariadaria/reviews_classifier")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("dariadaria/reviews_classifier") model = AutoModelForSequenceClassification.from_pretrained("dariadaria/reviews_classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
3d192a7
1
Parent(s): 3702b9d
Update handler.py
Browse files- handler.py +1 -2
handler.py
CHANGED
|
@@ -37,13 +37,12 @@ class EndpointHandler:
|
|
| 37 |
id = data.pop("id", data)
|
| 38 |
text = data.pop("text", data)
|
| 39 |
batch = {
|
| 40 |
-
'id':
|
| 41 |
'text': [],
|
| 42 |
'topic': []
|
| 43 |
}
|
| 44 |
|
| 45 |
for topic in topics:
|
| 46 |
-
batch['id'].append(id)
|
| 47 |
batch['text'].append(text)
|
| 48 |
batch['topic'].append(topic)
|
| 49 |
|
|
|
|
| 37 |
id = data.pop("id", data)
|
| 38 |
text = data.pop("text", data)
|
| 39 |
batch = {
|
| 40 |
+
'id': id,
|
| 41 |
'text': [],
|
| 42 |
'topic': []
|
| 43 |
}
|
| 44 |
|
| 45 |
for topic in topics:
|
|
|
|
| 46 |
batch['text'].append(text)
|
| 47 |
batch['topic'].append(topic)
|
| 48 |
|