Instructions to use xcczach/test-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xcczach/test-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="xcczach/test-model", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("xcczach/test-model", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Upload model
Browse files- modeling_test.py +2 -2
modeling_test.py
CHANGED
|
@@ -24,10 +24,10 @@ class TestModel(PreTrainedModel):
|
|
| 24 |
repo_id = self.path,
|
| 25 |
filename = "output1.wav",
|
| 26 |
repo_type = "model",
|
| 27 |
-
|
| 28 |
)
|
| 29 |
arr, sr = librosa.load(audio_path)
|
| 30 |
-
return librosa.get_duration(arr, sr)
|
| 31 |
|
| 32 |
def forward(self, tensor):
|
| 33 |
return self.model1(tensor)
|
|
|
|
| 24 |
repo_id = self.path,
|
| 25 |
filename = "output1.wav",
|
| 26 |
repo_type = "model",
|
| 27 |
+
local_dir = os.path.dirname(os.path.abspath(__file__))
|
| 28 |
)
|
| 29 |
arr, sr = librosa.load(audio_path)
|
| 30 |
+
return librosa.get_duration(y=arr, sr=sr)
|
| 31 |
|
| 32 |
def forward(self, tensor):
|
| 33 |
return self.model1(tensor)
|