Views
No views yet
1# For llama.cpp / Ollama usage
2# llama-cli -m asr-to-bash-q4_k_m.gguf -p 'Convert: list all files'
3
4# Or with Python:
5from transformers import AutoModelForCausalLM, AutoTokenizer
6
7model = AutoModelForCausalLM.from_pretrained("marksverdhai/asr-to-bash")
8tokenizer = AutoTokenizer.from_pretrained("marksverdhai/asr-to-bash")
9
10messages = [
11 {"role": "system", "content": "You are a helpful assistant that converts spoken commands into bash commands."},
12 {"role": "user", "content": "Convert this spoken command to bash: list all files including hidden ones"}
13]
14
15inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
16outputs = model.generate(inputs, max_new_tokens=50)
17print(tokenizer.decode(outputs[0]))
18# Output: ls -la| ASR Transcription | Bash Command |
|---|---|
| "list all files" | ls -la |
| "git status" | git status |
| "change directory to home" | cd ~ |
| "kill process one two three four" | kill 1234 |
| "show running containers" | docker ps |
google/functiongemma-270m-it