You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alternatively, one can perform inference using the `huggingface_hub` Python SDK. You can install it via pip as `pip install --upgrade --quiet huggingface_hub`, and then run:
125
-
126
-
```python
127
-
from huggingface_hub import InferenceClient
128
-
129
-
client = InferenceClient()
130
-
embedding = client.feature_extraction("What is deep learning?",
131
-
model="http://localhost:8080/rerank")
132
-
print(len(embedding[0]))
133
-
```
134
-
135
124
### Sequence classification models
136
125
137
126
You can also use classic Sequence Classification models like [`SamLowe/roberta-base-go_emotions`](https://huggingface.co/SamLowe/roberta-base-go_emotions):
Alternatively, one can perform inference using the `huggingface_hub` Python SDK. You can install it via pip as `pip install --upgrade --quiet huggingface_hub`, and then run:
156
-
157
-
```python
158
-
from huggingface_hub import InferenceClient
159
-
160
-
client = InferenceClient()
161
-
embedding = client.feature_extraction("What is deep learning?",
162
-
model="http://localhost:8080/predict")
163
-
print(len(embedding[0]))
164
-
```
165
-
166
144
## Batching
167
145
168
146
You can send multiple inputs in a batch. For example, for embeddings:
0 commit comments