Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ _generate/
*.py[cod]
*.egg-info
*env*
# install -e artifacts
_version.py
libggml*
libwhisper*

# ignore downloaded source code... really this is just for quickly checking previous versions
pywhispercpp-*.*



# custom
.idea
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ options:
```python
import _pywhispercpp as pwcpp

ctx = pwcpp.whisper_init_from_file('path/to/ggml/model')
ctx = pwcpp.whisper_init_from_file_with_params(
'path/to/ggml/model',
pwcpp.whisper_context_default_params(),
)
```

# Discussions and contributions
Expand All @@ -302,4 +305,4 @@ If you have any feedback, or you want to share how you are using this project, f

# License

This project is licensed under the same license as [whisper.cpp](https://github.com/ggerganov/whisper.cpp/blob/master/LICENSE) (MIT [License](./LICENSE)).
This project is licensed under the same license as [whisper.cpp](https://github.com/ggerganov/whisper.cpp/blob/master/LICENSE) (MIT [License](./LICENSE)).
46 changes: 44 additions & 2 deletions pywhispercpp/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
'type': bool,
'description': "do not use past transcription (if any) as initial prompt for the decoder",
'options': None,
'default': True
},
'no_timestamps': {
'type': bool,
'description': "do not generate timestamps",
'options': None,
'default': False
},
'single_segment': {
Expand Down Expand Up @@ -164,12 +170,24 @@
'options': None,
'default': 0
},
'debug_mode': {
'type': bool,
'description': "enable debug mode in whisper.cpp",
'options': None,
'default': False
},
'audio_ctx': {
'type': int,
'description': "overwrite the audio context size (0 = use default)",
'options': None,
'default': 0
},
'tdrz_enable': {
'type': bool,
'description': "enable tinydiarize speaker turn detection",
'options': None,
'default': False
},
'initial_prompt': {
'type': str,
'description': "Initial prompt, these are prepended to any existing text context from a previous call",
Expand All @@ -188,12 +206,24 @@
'options': None,
'default': 0
},
'carry_initial_prompt': {
'type': bool,
'description': "always prepend the initial prompt to each decode window",
'options': None,
'default': False
},
'language': {
'type': str,
'description': 'for auto-detection, set to None, "" or "auto"',
'options': None,
'default': ""
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should remain "" for auto-detecting the language by default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, you're right. Originally I was trying to match the default whisper-cli args which defaults to en. Once I realized I was going about it the wrong way I had to change a bunch of stuff. I'll change it back to an empty string and provide a cleaner README shortly

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, gotcha .. no worries.

},
'detect_language': {
'type': bool,
'description': 'enable automatic language detection during transcription',
'options': None,
'default': False
},
'suppress_blank': {
'type': bool,
'description': 'common decoding parameters',
Expand All @@ -206,6 +236,18 @@
'options': None,
'default': False
},
'suppress_nst': {
'type': bool,
'description': 'canonical whisper.cpp name for non-speech token suppression',
'options': None,
'default': False
},
'suppress_regex': {
'type': str,
'description': 'regex pattern used to suppress matching text during decoding',
'options': None,
'default': ''
},
'temperature': {
'type': float,
'description': 'initial decoding temperature',
Expand Down Expand Up @@ -252,7 +294,7 @@
'type': dict,
'description': 'greedy',
'options': None,
'default': {"best_of": -1}
'default': {"best_of": 5}
},
'beam_search': {
'type': dict,
Expand All @@ -264,7 +306,7 @@
'type': bool,
'description': 'calculate the geometric mean of token probabilities for each segment.',
'options': None,
'default': True
'default': False
},
'vad': {
'type': bool,
Expand Down
Loading
Loading