blib/lib/Langertha/Role/ContextSize.pm

filter: Statementstmt 80.0% 8 / 10 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 70.5% 12 / 17 CC 3 SCAR 14.2
CC
3
Cov
64%
get_context_size
5.2
BEGIN
1.0
CRAP 4.1
« blib/lib/Langertha/Engine/HuggingFace.pm ↑ Summary blib/lib/Langertha/Chat.pm »
1 package Langertha::Role::ContextSize;
2 # ABSTRACT: Role for an engine where you can specify the context size (in tokens)
3 58 our $VERSION = '0.505';
4 58 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 58 has context_size => (
7 isa => 'Int',
8 is => 'ro',
9 predicate => 'has_context_size',
10 );
11  
12  
13 2 ▶sub get_context_size {
Subroutine get_context_size: called CC=3 SCAR=16.5
Pod documented
14 2 my ( $self ) = @_;
15 2 ▶ return $self->context_size if $self->has_context_size;
Branch: 1 branch
BranchTrueFalseTotal
if $self->has_context_size 2 0 2
16 0 ▶ return $self->default_context_size if $self->can('default_context_size');
Branch: 1 branch
BranchTrueFalseTotal
if $self->can("default_context_size") 0 0 0
17 0 return;
18 }
19  
20  
21  
22 58 1;
23  
24 __END__
« blib/lib/Langertha/Engine/HuggingFace.pm ↑ Summary blib/lib/Langertha/Chat.pm »