Search This Blog

Friday, October 18, 2024

Open ai - azure services

 Great video series 


Open ai links 


Use AI to chat with a SQL Database 2.0

https://www.youtube.com/watch?v=hw6oTjw9_Ro https://www.youtube.com/watch?v=REw3y_Jv3Ig





Learn Azure OpenAI - Getting Started

https://www.youtube.com/watch?v=c66y0W5KFVY



Stable Diffusion AI - a simple intro. Set up and create AI images locally

https://www.youtube.com/watch?v=_K2E0kJfb8A



Local AI models! Code with Ollama and Phi3.

https://www.youtube.com/watch?v=177qX6mpyMg


Use Semantic Kernel to build AI Apps and Agents - a simple intro!

Add power (extension) to openai - e.g. get from rss live content

https://www.youtube.com/watch?v=kCGZPhnTGHM


Host your own AI Model in 10 minutes...for free!

Docker - for ollama - all in azure

https://www.youtube.com/watch?v=WKj8lo-ZbY4





https://www.youtube.com/watch?v=fFgyOucIFuk

https://www.youtube.com/watch?v=ztBJqzBU5kc


private GPT
https://github.com/zylon-ai/private-gpt

https://www.youtube.com/watch?v=XFiof0V3nhA




Great sample 


azure real time api

https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/voicerag-an-app-pattern-for-rag-voice-using-azure-ai-search-and/ba-p/4259116


https://www.youtube.com/watch?v=u5Vcrwpzoz8

https://www.youtube.com/watch?v=i-txsBoTJtI



Tuesday, April 2, 2024

Cpu cycles counter for linux in C++

 #include <stdio.h>

#include <stdlib.h>
#include <unistd.h>
#include <asm/unistd.h>
#include <linux/perf_event.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <stdint.h>
// Structure for perf_event_attr
struct perf_event_attr pe;


// need permsiion  on perf_event_open
// to see value ->
// cat /proc/sys/kernel/perf_event_paranoid

//0: Allows access to all users to use perf_event_open for monitoring performance events.
//1: Allows access only to privileged users (typically root) to use perf_event_open.
//2: Disallows access to all users to use perf_event_open

//sudo sysctl kernel.perf_event_paranoid=<new_value>

// Function to initialize and read CPU cycle count
uint64_t read_cpu_cycles() {
    // Initialize perf_event_attr structure
    memset(&pe, 0, sizeof(struct perf_event_attr));
    pe.type = PERF_TYPE_HARDWARE;
    pe.config = PERF_COUNT_HW_CPU_CYCLES;

    // Open the event
    int fd = syscall(__NR_perf_event_open, &pe, 0, -1, -1, 0);
    if (fd == -1) {
        perror("Error opening leader %llx");
        //exit(EXIT_FAILURE);
        return 0;
    }

    // Read the counter
    uint64_t count;
    read(fd, &count, sizeof(uint64_t));

    // Close the event
    close(fd);

    return count;
}

Tuesday, January 9, 2024

Handling Large file - generated

Dealing with Large Symbol Files


nice tool to compress exe or runtime file on linux 
use UPX

Tuesday, December 26, 2023

C++ improve your memory allocation

 

Arena allocation is a C++-only feature that helps you optimize your memory usage and improve performance when working with protocol buffers.


C++ Arena Allocation Guide




Saturday, June 3, 2023