Skip to main content

Posts

Showing posts with the label finetune

Gemma 2B Fine Tuned Lightweight model

 Kaggle Notebook Gemma 2B Fine Tuned Lightweight model Step 1: Configure GPU for Memory Growth python gpus = tf.config.list_physical_devices( 'GPU' ) if gpus: try : for gpu in gpus: tf.config.experimental.set_memory_growth(gpu, True ) print ( "GPU memory growth enabled." ) except RuntimeError as e: print (e) else : print ( "No GPU found. Using CPU." ) Purpose : Ensures the GPU is set to dynamically allocate memory instead of pre-allocating all available GPU memory. This approach prevents memory wastage and allows multiple processes to use the GPU without running into memory allocation errors. Technical Details : tf.config.list_physical_devices('GPU') : Lists available GPUs. tf.config.experimental.set_memory_growth(gpu, True) : Allows TensorFlow to allocate GPU memory on demand. Fallback : If no GPU is found, the code defaults to CPU computation. Step 2: Enable Mixed Precision for Memory Optimizatio...