Skip to content

Commit

Permalink
Update models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXBLACK11 authored Nov 17, 2023
1 parent 3ffb5f9 commit 8bf8331
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions laser_encoders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,17 @@ def initialize_encoder(

class LaserEncoderPipeline:
def __init__(
self, lang: str = None, model_dir: str = None, spm: bool = True, laser: str = None
self,
lang: str = None,
model_dir: str = None,
spm: bool = True,
laser: str = None
):

if laser == "laser2" and lang is not None:
print("Warning: The 'lang' parameter is optional when using 'laser2'. It will be ignored.")
print(
"Warning: The 'lang' parameter is optional when using 'laser2'. It will be ignored."
)

if laser == "laser3" and lang is None:
raise ValueError("For 'laser3', the 'lang' parameter is required.")
Expand Down

0 comments on commit 8bf8331

Please sign in to comment.