Instructions to use TechCarbasa/MyModels with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use TechCarbasa/MyModels with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="TechCarbasa/MyModels", filename="workspace/ComfyUI/models/WanVideo/Wan2.1-single/wan2.1-i2v-14b-480p-Q5_0.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TechCarbasa/MyModels with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf TechCarbasa/MyModels:Q5_0 # Run inference directly in the terminal: llama-cli -hf TechCarbasa/MyModels:Q5_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf TechCarbasa/MyModels:Q5_0 # Run inference directly in the terminal: llama-cli -hf TechCarbasa/MyModels:Q5_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf TechCarbasa/MyModels:Q5_0 # Run inference directly in the terminal: ./llama-cli -hf TechCarbasa/MyModels:Q5_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf TechCarbasa/MyModels:Q5_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf TechCarbasa/MyModels:Q5_0
Use Docker
docker model run hf.co/TechCarbasa/MyModels:Q5_0
- LM Studio
- Jan
- Ollama
How to use TechCarbasa/MyModels with Ollama:
ollama run hf.co/TechCarbasa/MyModels:Q5_0
- Unsloth Studio
How to use TechCarbasa/MyModels with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for TechCarbasa/MyModels to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for TechCarbasa/MyModels to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for TechCarbasa/MyModels to start chatting
- Pi
How to use TechCarbasa/MyModels with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf TechCarbasa/MyModels:Q5_0
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "TechCarbasa/MyModels:Q5_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use TechCarbasa/MyModels with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf TechCarbasa/MyModels:Q5_0
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default TechCarbasa/MyModels:Q5_0
Run Hermes
hermes
- Docker Model Runner
How to use TechCarbasa/MyModels with Docker Model Runner:
docker model run hf.co/TechCarbasa/MyModels:Q5_0
- Lemonade
How to use TechCarbasa/MyModels with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TechCarbasa/MyModels:Q5_0
Run and chat with the model
lemonade run user.MyModels-Q5_0
List all available models
lemonade list
Upload /workspace/ComfyUI/models/transformers/TencentGameMate/chinese-wav2vec2-base/README.md with huggingface_hub
Browse files
workspace/ComfyUI/models/transformers/TencentGameMate/chinese-wav2vec2-base/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
Pretrained on 10k hours WenetSpeech L subset. More details in [TencentGameMate/chinese_speech_pretrain](https://github.com/TencentGameMate/chinese_speech_pretrain)
|
| 5 |
+
|
| 6 |
+
This model does not have a tokenizer as it was pretrained on audio alone.
|
| 7 |
+
In order to use this model speech recognition, a tokenizer should be created and the model should be fine-tuned on labeled text data.
|
| 8 |
+
|
| 9 |
+
python package:
|
| 10 |
+
transformers==4.16.2
|
| 11 |
+
|
| 12 |
+
```python
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
import torch
|
| 16 |
+
import torch.nn.functional as F
|
| 17 |
+
import soundfile as sf
|
| 18 |
+
from fairseq import checkpoint_utils
|
| 19 |
+
|
| 20 |
+
from transformers import (
|
| 21 |
+
Wav2Vec2FeatureExtractor,
|
| 22 |
+
Wav2Vec2ForPreTraining,
|
| 23 |
+
Wav2Vec2Model,
|
| 24 |
+
)
|
| 25 |
+
from transformers.models.wav2vec2.modeling_wav2vec2 import _compute_mask_indices
|
| 26 |
+
|
| 27 |
+
model_path=""
|
| 28 |
+
wav_path=""
|
| 29 |
+
mask_prob=0.0
|
| 30 |
+
mask_length=10
|
| 31 |
+
|
| 32 |
+
feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(model_path)
|
| 33 |
+
model = Wav2Vec2Model.from_pretrained(model_path)
|
| 34 |
+
|
| 35 |
+
# for pretrain: Wav2Vec2ForPreTraining
|
| 36 |
+
# model = Wav2Vec2ForPreTraining.from_pretrained(model_path)
|
| 37 |
+
|
| 38 |
+
model = model.to(device)
|
| 39 |
+
model = model.half()
|
| 40 |
+
model.eval()
|
| 41 |
+
|
| 42 |
+
wav, sr = sf.read(wav_path)
|
| 43 |
+
input_values = feature_extractor(wav, return_tensors="pt").input_values
|
| 44 |
+
input_values = input_values.half()
|
| 45 |
+
input_values = input_values.to(device)
|
| 46 |
+
|
| 47 |
+
# for Wav2Vec2ForPreTraining
|
| 48 |
+
# batch_size, raw_sequence_length = input_values.shape
|
| 49 |
+
# sequence_length = model._get_feat_extract_output_lengths(raw_sequence_length)
|
| 50 |
+
# mask_time_indices = _compute_mask_indices((batch_size, sequence_length), mask_prob=0.0, mask_length=2)
|
| 51 |
+
# mask_time_indices = torch.tensor(mask_time_indices, device=input_values.device, dtype=torch.long)
|
| 52 |
+
|
| 53 |
+
with torch.no_grad():
|
| 54 |
+
outputs = model(input_values)
|
| 55 |
+
last_hidden_state = outputs.last_hidden_state
|
| 56 |
+
|
| 57 |
+
# for Wav2Vec2ForPreTraining
|
| 58 |
+
# outputs = model(input_values, mask_time_indices=mask_time_indices, output_hidden_states=True)
|
| 59 |
+
# last_hidden_state = outputs.hidden_states[-1]
|
| 60 |
+
|
| 61 |
+
```
|