Skip to content

Commit

Permalink
Deploying to gh-pages from @ 383d063 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
minhthuc2502 committed Oct 22, 2024
1 parent be1828f commit 811364d
Show file tree
Hide file tree
Showing 103 changed files with 951 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 2a4bd9441600d6f87ec45cdb9c8c85e0
config: 67a75a999b8281c3988fcac7056d30e5
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/python/ctranslate2.GenerationResult.doctree
Binary file not shown.
Binary file modified .doctrees/python/ctranslate2.TranslationResult.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .doctrees/python/ctranslate2.models.doctree
Binary file not shown.
Binary file modified .doctrees/python/ctranslate2.specs.Activation.doctree
Binary file not shown.
Binary file modified .doctrees/python/ctranslate2.specs.LanguageModelSpec.doctree
Binary file not shown.
Binary file not shown.
Binary file modified .doctrees/python/ctranslate2.specs.doctree
Binary file not shown.
Binary file modified .doctrees/quantization.doctree
Binary file not shown.
26 changes: 26 additions & 0 deletions _sources/python/ctranslate2.models.Wav2Vec2Bert.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Wav2Vec2Bert
============

.. autoclass:: ctranslate2.models.Wav2Vec2Bert
:members:
:undoc-members:
:inherited-members:

**Inherits from:** :class:`pybind11_builtins.pybind11_object`

**Attributes:**

- :obj:`~ctranslate2.models.Wav2Vec2Bert.compute_type`
- :obj:`~ctranslate2.models.Wav2Vec2Bert.device`
- :obj:`~ctranslate2.models.Wav2Vec2Bert.device_index`
- :obj:`~ctranslate2.models.Wav2Vec2Bert.model_is_loaded`
- :obj:`~ctranslate2.models.Wav2Vec2Bert.num_active_batches`
- :obj:`~ctranslate2.models.Wav2Vec2Bert.num_queued_batches`
- :obj:`~ctranslate2.models.Wav2Vec2Bert.num_workers`
- :obj:`~ctranslate2.models.Wav2Vec2Bert.tensor_parallel`

**Methods:**

- :obj:`~ctranslate2.models.Wav2Vec2Bert.encode`
- :obj:`~ctranslate2.models.Wav2Vec2Bert.load_model`
- :obj:`~ctranslate2.models.Wav2Vec2Bert.unload_model`
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ WhisperGenerationResult

**Attributes:**

- :obj:`~ctranslate2.models.WhisperGenerationResult.logits`
- :obj:`~ctranslate2.models.WhisperGenerationResult.no_speech_prob`
- :obj:`~ctranslate2.models.WhisperGenerationResult.scores`
- :obj:`~ctranslate2.models.WhisperGenerationResult.sequences`
Expand Down
1 change: 1 addition & 0 deletions _sources/python/ctranslate2.models.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ctranslate2.models
.. toctree::

ctranslate2.models.Wav2Vec2
ctranslate2.models.Wav2Vec2Bert
ctranslate2.models.Whisper
ctranslate2.models.WhisperGenerationResult
ctranslate2.models.WhisperGenerationResultAsync
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ LanguageModelSpec

- :class:`ctranslate2.specs.TransformerDecoderModelSpec`
- :class:`ctranslate2.specs.TransformerEncoderModelSpec`
- :class:`ctranslate2.specs.Wav2Vec2BertSpec`
- :class:`ctranslate2.specs.Wav2Vec2Spec`
- :class:`ctranslate2.specs.WhisperSpec`

Expand Down
26 changes: 26 additions & 0 deletions _sources/python/ctranslate2.specs.Wav2Vec2BertSpec.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Wav2Vec2BertSpec
================

.. autoclass:: ctranslate2.specs.Wav2Vec2BertSpec
:members:
:undoc-members:
:inherited-members:

**Inherits from:** :class:`ctranslate2.specs.LanguageModelSpec`

**Attributes:**

- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.config`
- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.name`
- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.revision`

**Methods:**

- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.get_default_config`
- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.get_vocabulary_size`
- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.optimize`
- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.register_file`
- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.register_vocabulary`
- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.save`
- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.validate`
- :obj:`~ctranslate2.specs.Wav2Vec2BertSpec.variables`
1 change: 1 addition & 0 deletions _sources/python/ctranslate2.specs.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ ctranslate2.specs
ctranslate2.specs.TransformerEncoderModelSpec
ctranslate2.specs.TransformerEncoderSpec
ctranslate2.specs.TransformerSpec
ctranslate2.specs.Wav2Vec2BertSpec
ctranslate2.specs.Wav2Vec2Spec
ctranslate2.specs.WhisperSpec
16 changes: 12 additions & 4 deletions _sources/quantization.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,26 @@ In this mode, all model weights are stored in BF16 and all layers are run with t

### 4-bit AWQ

The compute type would be `int32_float16`

**Supported on:**

* NVIDIA GPU with Compute Capability >= 7.5

CTranslate2 internally handles the compute type for AWQ quantization.
In this mode, all model weights are stored in half precision and all layers are run in half precision. Other parameters like scale and zero are stored in ``int32``.

For example,
**Steps to use AWQ Quantization:**

* Download a AWQ quantized model from Hugging Face for example (TheBloke/Llama-2-7B-AWQ){https://huggingface.co/TheBloke/Llama-2-7B-AWQ} or quantize your own model with using this (AutoAWQ example){https://casper-hansen.github.io/AutoAWQ/examples/}.

* Convert AWQ Quantized model to Ctranslate2 model:
```bash
ct2-transformers-converter --model TheBloke/Llama-2-7B-AWQ --copy_files tokenizer.model --output_dir ct2_model
```

We have to quantize the model with AWQ first, then convert it to CT2 format.
* Run inference as usual with Ctranslate2:
```bash
model = ctranslate2.Generator('ct2_model', device='cuda')
outputs = model.generate_batch([tokens])
```

Currently, CTranslate2 only supports the GEMM and GEMV kernels for AWQ quantization.
2 changes: 1 addition & 1 deletion _static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '4.4.0',
VERSION: '4.5.0',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
4 changes: 2 additions & 2 deletions conversion.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Model conversion &mdash; CTranslate2 4.4.0 documentation</title>
<title>Model conversion &mdash; CTranslate2 4.5.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
Expand Down Expand Up @@ -32,7 +32,7 @@
<a href="index.html" class="icon icon-home"> CTranslate2
</a>
<div class="version">
4.4
4.5
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
4 changes: 2 additions & 2 deletions decoding.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Decoding features &mdash; CTranslate2 4.4.0 documentation</title>
<title>Decoding features &mdash; CTranslate2 4.5.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
Expand Down Expand Up @@ -32,7 +32,7 @@
<a href="index.html" class="icon icon-home"> CTranslate2
</a>
<div class="version">
4.4
4.5
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
4 changes: 2 additions & 2 deletions encoding.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Text encoding &mdash; CTranslate2 4.4.0 documentation</title>
<title>Text encoding &mdash; CTranslate2 4.5.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
Expand Down Expand Up @@ -32,7 +32,7 @@
<a href="index.html" class="icon icon-home"> CTranslate2
</a>
<div class="version">
4.4
4.5
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
4 changes: 2 additions & 2 deletions environment_variables.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Environment variables &mdash; CTranslate2 4.4.0 documentation</title>
<title>Environment variables &mdash; CTranslate2 4.5.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
Expand Down Expand Up @@ -32,7 +32,7 @@
<a href="index.html" class="icon icon-home"> CTranslate2
</a>
<div class="version">
4.4
4.5
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
4 changes: 2 additions & 2 deletions faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Frequently asked questions &mdash; CTranslate2 4.4.0 documentation</title>
<title>Frequently asked questions &mdash; CTranslate2 4.5.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
Expand Down Expand Up @@ -32,7 +32,7 @@
<a href="index.html" class="icon icon-home"> CTranslate2
</a>
<div class="version">
4.4
4.5
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
4 changes: 2 additions & 2 deletions generation.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Text generation &mdash; CTranslate2 4.4.0 documentation</title>
<title>Text generation &mdash; CTranslate2 4.5.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
Expand Down Expand Up @@ -32,7 +32,7 @@
<a href="index.html" class="icon icon-home"> CTranslate2
</a>
<div class="version">
4.4
4.5
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
Loading

0 comments on commit 811364d

Please sign in to comment.