Skip to main content

46 posts tagged with "azure"

azure

View All Tags

Microsoft Azure OpenAI Hackathon

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

Recently, I came across the Microsoft Azure OpenAI Hackathon and couldn't resist giving it a go! With the help of the detailed online instructions, I was able to follow along easily and dive into some really exciting AI technologies. The step-by-step tutorial provided a smooth learning experience, making the whole process engaging and informative.

During the hackathon, I gained valuable knowledge on several key technologies:

  • Cosmos DB: I learned how this scalable database can store and manage massive amounts of data, which is perfect for AI applications.
  • LangChain: This framework helped me understand how to integrate language models into real-world applications, particularly with the help of APIs and external data.
  • RAG (Retrieval-Augmented Generation): This was one of the most interesting parts! I built a chatbot that retrieves information from a knowledge base to give more accurate and relevant responses, blending both AI generation and data retrieval.

The experience got me thinking: how can I apply a similar approach to improve AI coding for LEGO Spike Prime robots using Python? Could we potentially use tools like Cosmos DB, LangChain, and Retrieval-Augmented Generation to enhance the way robots process commands and interact?

Imagine a chatbot-like interface for programming robots, where the AI retrieves the most efficient and specific commands from a knowledge base to guide the robot's movements and tasks. It opens up a world of possibilities! Could we fine-tune a model that combines language generation with real-time data, and use it to make robotics coding smarter and more intuitive?

The hackathon has definitely sparked some new ideas for how we can push the boundaries of AI-powered robotics programming. I'm eager to explore these possibilities further and see how we can take our LEGO robot AI coding to the next level!

Update: got my completion badge!

alt text

Azure Global Sydney 2024 Tech Talk

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

I'm excited to share that today I had the incredible opportunity to attend the Global Azure Sydney 2024 user group session at the Microsoft Reactor today! Even more thrilling, I got to present my experiences with AI and coding during the event. It was an amazing moment to share my journey, including how I've been exploring AI model fine-tuning and integrating it with robotics like Spike Prime. Feeling grateful for the chance to connect with so many passionate people in the field and exchange ideas!

alt text

alt text

alt text

alt text

Here's a quick overview of my talk and some key takeaways:

  • The Power of AI in Code Generation: I dive into how I've been using Azure's fine-tuning to create more efficient, domain-specific code for robotics.
  • From Generic Python to Robot-Specific Commands: I shared my experience building models that turn general Python code into Spike Prime-specific instructions.
  • Azure Endpoint Integration: I walked through how to set up and connect an AI model to a local environment, demonstrating real-time interactions with the Spike Prime robot.

The feedback I received was beyond amazing! Attendees from all over the world were interested in how AI can assist with robotics programming and coding efficiency. The response from the team at Microsoft was also incredibly positive, sparking some great conversations on future collaborations and projects.

I had a fantastic day at Microsoft Reactor in Sydney, a space filled with innovation and learning. The energy was contagious, and I left with so many new ideas and connections.


You can watch the full session here:

Watch My Azure Global Sydney 2024 Talk

Integrate GPT 3.5 model with Spike Prime 3

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

We've made great progress in our journey to fine-tune an AI model for Spike Prime robots. With the training dataset and validation dataset ready, it's time to take the next step: setting up an Azure endpoint and integrating it with our local Python script.

First, we configured the Azure endpoint to allow us to send and receive data. This will enable our fine-tuned model to process instructions in real-time. By doing this, we can interact with the model directly from our local machine, making it easy to integrate AI-powered code suggestions into our Spike Prime project.

For the robot connection, we used a serial port interface. This allowed us to send commands from the Python script running on our local machine to the robot in real-time. This setup ensures that we can test and execute movements and commands on the fly.

The results look promising so far. The fine-tuned model has demonstrated an ability to stick closely to the instructions we provided. It seems to understand the specifics of the Spike Prime movement commands, offering more accurate code suggestions than a generic model.

alt text

Here's a glimpse of what we've tried so far:

  • Moving forward: The model was able to generate precise movement commands using Spike Prime-specific syntax.
  • Turning: We tested multiple turning scenarios, and the model successfully adjusted the turning angle based on the instructions.
  • Combining movements: The fine-tuned model was able to chain together commands, making the robot perform complex maneuvers smoothly.

The integration between Azure and our local environment is working well, and the fine-tuned model is proving to be a valuable tool in generating Spike Prime-specific Python code. As we continue to refine the model, I'm excited to see how far we can take it!

Use fune-tuned gpt 3.5 model to write python

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

Over the last 12 months, I've been amazed by all the developments happening in the AI world. From advancements in natural language processing to AI-driven coding tools, it's clear that AI is transforming the tech landscape faster than ever. With all the buzz, I decided to set a challenge for myself: to build an AI app from scratch.

I've heard a lot about is Azure's fine-tuning capabilities. The idea behind fine-tuning is to take a generic AI model and specialize it for a particular task or domain. In my case, I want to see if I can fine-tune a model to improve the accuracy of Python coding snippets, specifically for Spike Prime robots.

alt text

Spike Prime is a versatile LEGO robotics kit that allows users to program movements and interactions. While generic Python code can be used to program the robots, I'm curious if fine-tuning a model on Azure can make the code more optimized for Spike Prime's specific needs.

This will be my first time building a fine-tuned model on Azure, so I want to make the process as smooth as possible. Instead of trying to fine-tune every Python function related to Spike Prime, I've decided to narrow the scope and focus only on a few scenarios, such as robot movement and turning.

The fine-tuning process for this project looks like this:

  1. Dataset preparation: Gather Python code snippets that are specifically tailored for Spike Prime, focusing on movement and turning functions.
  2. Fine-tuning: Use Azure's fine-tuning service to train the model with this specialized dataset.
  3. Testing: Evaluate the fine-tuned model by inputting generic Python code and observing how it converts the code to a more Spike Prime-specific version.

This is just the beginning, and I'm excited to see what kind of improvements we can achieve. Stay tuned as I dive deeper into the world of AI fine-tuning and robotics!

(Notice) Azure Global Sydney 2024 Tech Talk

· One min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

Join me for an exciting session where we'll have some fun with Lego SpikePrime Robot and AzureOpenAI. I'm proud to be presenting at Global Azure Sydney 2024 - Microsoft Reactor Sydney @ 20/04/2024.

📌 Session: Fine-tune GPT-3.5 model to control Lego Robot using Azure OpenAI & Python 🗣️ Speaker: Daniel Fang

Session details: https://sessionize.com/view/rjfzv8k0/GridSmart?format=Embed_Styled_Html&isDark=False&title=Global%20Azure%20Sydney%202024 Reserve your spot: https://www.tickettailor.com/events/azuresydneyusergroup/1193113

alt text

alt text

alt text

alt text

Read more via LinkedIn Post

Use ChatGPT to write python code

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

Recently, I found myself with some free time, and it brought back a memory from our robotics team. I remember one of the girls on the team trying to use ChatGPT to help her write code for our Masterpiece Season mission. She was hoping to get some assistance resolving a tricky problem with our robot. Unfortunately, even though the code it generated looked solid, it didn't run correctly when we tried it out on the robot.

Out of curiosity, I decided to give it a go myself to see what might have gone wrong. Here's an example of a Python snippet that looks fine at first glance:

import hub
from spike import PrimeHub, Motor, MotorPair

hub = PrimeHub()

motor_pair = MotorPair('A', 'B')

motor_pair.start(50, 0) # Move straight at 50% speed

The syntax is correct, and the code seems reasonable for controlling a Spike Prime robot. But when you upload this code to the robot, something weird happens: the robot doesn't quite behave the way it should. It might not move at all, or it could respond unpredictably.

So, what's going on here?

Well, after some quick troubleshooting, I realized there's a bit more to getting a Spike Prime robot working smoothly than just correct Python syntax. The code must align perfectly with the robot's specific hardware configuration, sensor inputs, and timing mechanisms. It's not just about writing Python - it's about writing the right Python for this context.

Looks like I've got an investigation on my hands. Time to dive deeper into how the Spike Prime API works and figure out why ChatGPT's code, while syntactically correct, doesn't hit the mark. It's a reminder that while AI tools can be incredibly useful, robotics is a nuanced field where hardware, software, and context all come into play.

If I crack the mystery, I'll be sure to share what I learn!