watsonx.ai

 View Only
  • 1.  Downloading a model from Hugging Face to my MacBook Pro

    Posted 2 days ago

    Dear All,

    I'm enrolled in the watsonx.ai Sales Technical Intermediate course.  I'm having trouble downloading a model (flan-t5-base) from Hugging Face to my MacBook Pro.  I have the latest version of python loaded to my Terminal.  When running the code that the Lab 3 guide provides, I receive an error that "no such file or directory."  I downloaded the model to Google Colab (Jupyter notebook) and attempted to mount the file to my Google Drive as a means to upload it to my watsonx.ai project sandbox, but that was not possible.  Any recommendations you can provide will be helpful.

    Thank you,

    Amir


    #GenerativeAI

    ------------------------------
    Amir Moore
    ------------------------------


  • 2.  RE: Downloading a model from Hugging Face to my MacBook Pro

    Posted yesterday

    Ensure transformers is installed by entering the following command in your terminal. 

    pip install transformers 

    Then try downloading the model locally again from hugging face.  If you get an error persist let  me know what it says.



    ------------------------------
    Patrick Ejelle-Ndille
    DevOps AI Engineer
    BroadComms
    Windsor ON
    ------------------------------



  • 3.  RE: Downloading a model from Hugging Face to my MacBook Pro

    Posted yesterday
    Hi Patrick,

    Thank you for your response.  

    This is the code that I'm given from the IBM Lab 3 guide:

    cd /Users/<username>/Downloads (no such file or directory is returned)
    mkdir CFM (directory created)
    python -m venv /Users/<username>/Downloads/CFM/venv (no errors)
    ls /Users/<username>/Downloads/CFM (no such file or directory is returned)

    How do I fix the "no such file or directory" errors?  There's no issue with the "pip install transformers" command.

    Thank you,
    Amir

    President and CEO
    Averroes Consulting Services, LLC
    Dba Averroes Management Consultancy
    (571) - 598 - 8779


    Confidentiality Notice: The content of this email, including all attachments, is the confidential and proprietary information of Averroes. The intellectual property, including the attached logo designs, is protected by copyright and other applicable laws. Unauthorized copying, sharing, or use of this material is strictly prohibited. If you are not the intended recipient, please delete this email and notify the sender immediately.





  • 4.  RE: Downloading a model from Hugging Face to my MacBook Pro

    Posted yesterday
    Edited by Patrick Ejelle-Ndille yesterday

    Hi Amir,

    Based on the error messages you provided:

    (no such file or directory is returned) indicates that you are trying to access a folder that does not exist.

    Identifying the Issue

    No username is specified on the directory file paths  in your commands. 
    For example, when you try to navigate to the Download folder using the cd command;

    cd /Users/<username>/Downloads (no such file or directory is returned)

    You must replace the <username> placeholder with the username of your computer.

    SOLUTION

    You can get your username from your terminal on mac or linux by using the command

    whoami

    Then replace <username> with the value that is returned.

    Alternatively, a more straight forward method would be to use the global variable $USER.

    You can also get your username to replace the <username> variable in your directory path by using the following command.

    echo $USER

    or just replace the <username> with the $USER variable in your commands as provided below:

    cd /Users/$USER/Downloads        # navigate to Downloads folder
    mkdir CFM                        # create new directory called CFM
    cd /Users/$USER/Download/CFM        # navigate to the CFM folder
    pwd                            # verify you are in the CFM directory
    python -m venv venv            # Initialize the virtual environment
    source venv/bin/activate        # Activate the virtual environment

    Let me know if you need additional assistance.
    Best regards,



    ------------------------------
    Patrick Ejelle-Ndille
    DevOps AI Engineer
    BroadComms
    Windsor ON
    ------------------------------



  • 5.  RE: Downloading a model from Hugging Face to my MacBook Pro

    Posted yesterday
    Hi Patrick,

    Thank you for the fixes.  I was able to download the hugging face model to my Macbook Pro.  Now I'm having trouble with the "Test Connection" step because there is an issue with the URL which pulled from the IBM Cloud Enpoints list (see image).  I created a ticket, wonder if they'll have a fix.  I'm 90% done with the lab, I just need to connect the data source to IBM COS and finish the remainder of the exercises.

    Thanks for any advice you can provide.

    Best regards,
    Amir

    President and CEO
    Averroes Consulting Services, LLC
    Dba Averroes Management Consultancy
    (571) - 598 - 8779


    Confidentiality Notice: The content of this email, including all attachments, is the confidential and proprietary information of Averroes. The intellectual property, including the attached logo designs, is protected by copyright and other applicable laws. Unauthorized copying, sharing, or use of this material is strictly prohibited. If you are not the intended recipient, please delete this email and notify the sender immediately.





  • 6.  RE: Downloading a model from Hugging Face to my MacBook Pro

    Posted yesterday
    Edited by Patrick Ejelle-Ndille yesterday

    Create a Connection to COS from watsonx.ai

    Login to ibmcloud.com to get your Access Key and Secrets.

    Make sure you select the right subscription for the environment you reserved on TechZone, usually in the format `itz-watsonx`.

    Select the `Navigation menu` (hamburger icon, top left)

    Navigate to `Resource List` and collapse `Storage`

    Select the Cloud Object Storage (COS) instance that was created for the project in your sandbox environment.

    Select your sandbox bucket, usually in a format like `yoursandbox-donotdelete-9383938393`

    Go to the `Configurations` tab and copy the following, as you will need them to make the connection from your watsonx.ai deployment space to this bucket on your COS:

    Bucket name: <your bucket name>

    Public Endpoint: s3.au-syd.cloud-object-storage.appdomain.cloud

    Next navigate to `Instances` on the left side box, and select the Cloud Object Storage instance again.

    Go to the `Service credentials` tab

    Click `New Credentials`

    Name: CFM_demo

    Role: Manager

    Include HMAC Credential: On (Ensure this is turned on)

    Click `Add`.

    Next, search for the "CFM_demo" key you just created from the list and click it.

    You should see a Json data format. Copy the values of the following fields in it.

    1. `access_key_id` <your access key>

    2. `secret_access_key` < your secret key>

    Now go to your deployment workspace on watsonx.ai

    From the `Navigation Menu` navigate to `Resource List`

    Collapse `AI / Machine Learning`

    Select `Watsonx.ai Studio`

    Collapse `Launch in` and select `watsonx.ai`

    From the Navigation Menu, select `Deployments`

    Create a deployment space if you haven't created one.

    On the Deployments page, go to the `Assets` tab

    Click on `Import assets` and then click on `Data access` on the left side box

    Click on the `Connection` card, then search for `IBM Cloud Object Storage` there is another option which ends with "Infrastructure" don't use that.

    Select the `IBM Cloud Object Storage` and click `Next`.

    Enter the following values we copied from above.

    Name: CFM_connect

    Bucket: <the name of the bucket we copied above>

    Login URL: <the URL of the bucket we copied above>

    Credentials: Access key and Secret key

    Access Key: <the access_key_id we copied from above>

    Secret Key: <the secret_access_key we copied from above>

    Now click `Test connection`

    It should return a green notification bar that says:

    The test was successful. Click Create to save the connection information.

    If the connection returned success click the `Create` to create the connection.

     Free to let me know, if you need any further assistance with watsonx.ai



    ------------------------------
    Patrick Ejelle-Ndille
    DevOps AI Engineer
    BroadComms
    Windsor ON
    ------------------------------