2121from .config import FinetuningConfig
2222from .pipeline .finetuning .finetuning import Finetuning
2323from .config import DeviceOptions , BackendOptions , AudioOptions
24- from models .base_model import get_model_adapter
24+ from . models .base_model import get_model_adapter
2525from .utils .common import get_device_type , get_backend_type
2626from .pipeline .plugins .caching .cache import init_similar_cache_from_config
2727from .pipeline .plugins .audio .asr import AudioSpeechRecognition
@@ -35,8 +35,11 @@ def build_chatbot(config: NeuralChatConfig):
3535 """Build the chatbot with a given configuration.
3636
3737 Args:
38- config (NeuralChatConfig): The class of NeuralChatConfig containing model path,
39- device, backend, plugin config etc.
38+ config (NeuralChatConfig): Configuration for building the chatbot.
39+
40+ Returns:
41+ adapter: The chatbot model adapter.
42+
4043 Example:
4144 from neural_chat.config import NeuralChatConfig
4245 from neural_chat.chatbot import build_chatbot
@@ -45,7 +48,7 @@ def build_chatbot(config: NeuralChatConfig):
4548 response = chatbot.predict("Tell me about Intel Xeon Scalable Processors.")
4649 """
4750 # Validate input parameters
48- if config .device not in [option .name for option in DeviceOptions ]:
51+ if config .device not in [option .name . lower () for option in DeviceOptions ]:
4952 valid_options = ", " .join ([option .name .lower () for option in DeviceOptions ])
5053 raise ValueError (f"Invalid device value '{ config .device } '. Must be one of { valid_options } " )
5154
@@ -111,10 +114,20 @@ def build_chatbot(config: NeuralChatConfig):
111114 return adapter
112115
113116def finetune_model (config : FinetuningConfig ):
117+ """Finetune the model based on the provided configuration.
118+
119+ Args:
120+ config (FinetuningConfig): Configuration for finetuning the model.
121+ """
122+
114123 assert config is not None , "FinetuningConfig is needed for finetuning."
115124 finetuning = Finetuning (config )
116125 finetuning .finetune ()
117126
118127def optimize_model (config : OptimizationConfig ):
119- # Implement the logic to optimize the model
128+ """Optimize the model based on the provided configuration.
129+
130+ Args:
131+ config (OptimizationConfig): Configuration for optimizing the model.
132+ """
120133 pass
0 commit comments