Posts

Showing posts from December, 2024

Fixing the DeepSpeed Import Error While Fine-Tuning the Qwen Model

While fine-tuning the Qwen model, I encountered an error in the finetune.py script: ImportError : cannot import name 'deepspeed' from 'transformers.deepspeed' After some investigation, I discovered the issue stems from a recent update in the Transformers library. The transformers.deepspeed module has been deprecated and replaced by transformers.integrations . To fix this, you need to update the import statement in your script. The Fix Replace this: from transformers.deepspeed import deepspeed With this: from transformers.integrations import deepspeed This small change resolved the error, allowing the fine-tuning process to proceed smoothly. Additional Resources For more details, refer to the discussion in the official Transformers GitHub repository: Issue #34582 Remember to keep your library versions up-to-date to avoid similar issues in the future! 

VPC, Private subnet, public subnet, Routing table and InternetGateway, NAT gateway

 Trước tiên chúng ta cần hiểu về khái niệm VPC  VPC là Một thành phố độc lập với các thành phố khác Sau đó chúng ta xây dựng 2 quận nhỏ trong thành phố này gọi là 2 subnets Về cơ bản thì 2 subnet này có dải mạng khác nhau nhưng do cùng trong thành phố nên chúng có thể nói chuyện và kết nối với nhau Tuy nhiên thì chúng vẫn không thể kết nối với các thiết bị hoặc tài nguyên khác bên ngoài thành phố Điều tiếp theo là chúng ta tạo ra một cái Internet gateway đóng vai trò như một cái cửa ngõ ra ngoài internet, để bước ra ngoài thành phố Và chúng ta sẽ lắp cái cửa ngõ này cho VPC, vì lúc ban đầu tạo ra thì cái cổng này nó đứng độc lập không gắn với bất kỳ VPC nào Tuy việc gắn cổng cho thành phố rồi nhưng các Subnet vẫn k thể kết nối internet Điều tiếp theo là cần phải tạo ra các routing table, nó đóng vai trò như những tuyến đường Các routing tables ban đầu đc tạo ra nó sẽ gắn vào VPC, sau đó thì trong Routing table nó sẽ định nghĩa các tuyến đường ví dụ như là đi từ Source là dải I...

Persistent Storage for Kubernetes with StorageClass

In Kubernetes, managing persistent storage involves creating a StorageClass , which defines the types of storage to be used for persistent volumes (PV). Here's a step-by-step explanation of how to use dynamic provisioning for persistent storage in a Kubernetes cluster. Step 1: Declare a StorageClass A StorageClass is a way to describe the provisioning of storage in a Kubernetes cluster. It defines parameters such as the storage provider (e.g., Amazon EBS, NFS, etc.) and other configuration details. Depending on your cluster, there may already be a default StorageClass . If not, you will need to manually declare one. Example of defining a StorageClass for Amazon EBS: apiVersion : storage.k8s.io/v1 kind : StorageClass metadata : name : ebs-sc provisioner : kubernetes.io/aws-ebs parameters : type : gp2 Step 2: Create a PersistentVolumeClaim (PVC) Once the StorageClass is defined, you can create a PersistentVolumeClaim (PVC) that requests a specific amount of storage from a S...