Instructions to use ArthurSynthia/clap1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ArthurSynthia/clap1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="ArthurSynthia/clap1")# Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("ArthurSynthia/clap1") model = AutoModel.from_pretrained("ArthurSynthia/clap1") - Notebooks
- Google Colab
- Kaggle
Commit ·
206504f
1
Parent(s): 202b18b
handler.py : JSON SERIALZATION
Browse files- handler.py +1 -1
handler.py
CHANGED
|
@@ -21,4 +21,4 @@ class EndpointHandler:
|
|
| 21 |
text_inputs = self.processor(text=query, return_tensors="pt")
|
| 22 |
text_embed = self.model.get_text_features(**text_inputs)[0]
|
| 23 |
gc.collect()
|
| 24 |
-
return text_embed
|
|
|
|
| 21 |
text_inputs = self.processor(text=query, return_tensors="pt")
|
| 22 |
text_embed = self.model.get_text_features(**text_inputs)[0]
|
| 23 |
gc.collect()
|
| 24 |
+
return text_embed.detach().numpy()
|