-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sliding window + chunking input for mistral model (#1524)
* sliding window + chunking input --------- Co-authored-by: thucpham <[email protected]>
- Loading branch information
1 parent
b64bb08
commit 120746e
Showing
11 changed files
with
278 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,4 @@ | |
#include "median_filter.h" | ||
#include "rotary.h" | ||
#include "alibi_add.h" | ||
#include "slide.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include "op.h" | ||
|
||
namespace ctranslate2 { | ||
namespace ops { | ||
|
||
class Slide : public Op { | ||
public: | ||
Slide(dim_t axis, const dim_t& index, const dim_t& size, bool no_copy = false); | ||
|
||
void operator()(const StorageView& input, StorageView& output) const; | ||
private: | ||
dim_t _axis; | ||
dim_t _index; | ||
dim_t _size; | ||
bool _no_copy; | ||
|
||
void check_arguments() const; | ||
|
||
template <Device D, typename T> | ||
void compute(const StorageView& input, StorageView& output, const dim_t& index) const; | ||
}; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.