Ir al contenido principal

Entradas

Mostrando las entradas etiquetadas como ai

[AI][GGUF MODELS][OLLAMA][LOCAL] Instalar un modelo de Huggingface en local sobre OLLAMA

1.- Instalar anaconda 2.- ejecutar anaconda prompt desde windows 3.- crear un espacio para el proyecto: conda create -n hf_1 python=3.11 4.- Activar entorno: conda activate hf_1 5.-Instalar utilidades para descargar modelos pip install -U "huggingface_hub[cli]" pip install huggingface_hub[hf_transfer] 6.- Configurar variable de entorno: HF_HUB_ENABLE_HF_TRANSFER = 1 7.- Descargar el modelo deseado. Por ejemplo: C:\Users\ username \anaconda3\envs\hf_1\Scripts huggingface-cli.exe download TheBloke/Wizard-Vicuna-7B-Uncensored-GGUF Wizard-Vicuna-7B-Uncensored.Q4_K_M.gguf (fijaros que tiene un nombre base del modelo y luego la versión que se quiere) 8.- Una vez descargado coger la última linea que aparece en el output de la instruccion anterior y crear un fichero llamado Modelfile (sin extensión). Ejemplo de contenido: FROM C:\Users\ username \.cache\huggingface\hub\models--TheBloke--Wizard-Vicuna-7B-Uncensored-GGUF\snapshots\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\Wizard-Vicuna-7B-Uncenso...

[NLP][AI][MATHS] Mathematical foundations of Neural Language Models (NLMs)

  Let’s delve into the mathematical foundations of   Neural Language Models (NLMs) , which form the basis for modern   Large Language Models (LLMs) : Representation Learning : NLMs aim to learn meaningful  continuous representations  (also known as  embeddings ) for words or tokens. Each word is mapped to a high-dimensional vector in a continuous space. These embeddings capture semantic relationships and contextual information. Feedforward Neural Networks (FNNs) : The simplest neural model consists of a single hidden layer with nonlinear activation functions. Given an input (word embedding), the network computes a hidden representation using weights and biases. The output layer predicts the next word or token. Recurrent Neural Networks (RNNs) : RNNs handle sequential data by maintaining hidden states across time steps. Each time step processes an input (word embedding) and updates the hidden state. RNNs suffer from vanishing gradients and struggle with long...

[NLP][AI] Differences between the n-gram approach and the neural approach in Large Language Models (LLMs)

  Let’s explore the differences between the   n-gram approach   and the   neural approach   in   Large Language Models (LLMs) : N-gram Approach : Definition : N-gram models use statistical and probabilistic techniques to determine the probability of a given sequence of words occurring in a sentence. Basic Idea : An n-gram is a contiguous sequence of n items (usually words) from a given text sample. Assumption : The probability of the next word in a sequence depends only on a fixed-size window of previous words (context). Strengths : Simplicity : N-gram models are straightforward and easy to implement. Efficiency : They can handle large datasets efficiently. Limitations : Local Context : N-grams consider only local context, which may not capture long-range dependencies. Sparsity : As n increases, the number of possible n-grams grows exponentially, leading to data sparsity. Fixed Context Window : The fixed context window may not adapt well to varying sentence...

AI:LLM:GREP: Regular expressions using "grep"

The regular expression [ˆa-zA-Z], which we used to avoid embedded instances of "the", implies that there must be some single (although non-alphabetic) character before the the. We can avoid this by specifying that before the the we require either the beginning-of-line or a non-alphabetic character, and the same at the end of the line:  grep -E "(^|[^a-zA-Z])[tT]he([^a-zA-Z]|^)" wizard_of_oz  The process we just went through was based on fixing two kinds of errors: false false positives positives, strings that we incorrectly matched like other or there, and false negafalse negatives tives, strings that we incorrectly missed, like The. Addressing these two kinds of errors comes up again and again in implementing speech and language processing systems. Reducing the overall error rate for an application thus involves two antagonistic efforts:  • Increasing precision (minimizing false positives)  • Increasing recall (minimizing false negatives) Some aliases for common...

AI: MATHS: El perceptron (teoría matemática)

  La teoría matemática del perceptrón es una rama de la inteligencia artificial que se centra en el estudio de los perceptrones, que son modelos matemáticos de neuronas artificiales. El perceptrón es un algoritmo de aprendizaje supervisado que se utiliza para clasificar objetos en diferentes categorías. El modelo se basa en una función discriminante lineal que utiliza pesos y umbrales para separar las diferentes clases de objetos. La función discriminante se calcula como la suma ponderada de las entradas multiplicadas por los pesos, y se compara con un umbral para determinar la clase a la que pertenece el objeto. El perceptrón se puede utilizar para resolver problemas de clasificación binaria y multiclase, y se ha utilizado en una amplia variedad de aplicaciones, como el reconocimiento de caracteres, la detección de spam y la clasificación de imágenes. Aquí hay una fórmula básica para un perceptrón: El objetivo del aprendizaje del perceptrón es ajustar los pesos y el sesgo para qu...

AI: LARGE LANGUAGE MODEL: Create a Large Language Model from Scratch with Python – Tutorial

AI: Guía de aprendizaje de Inteligencia Artificial con Python

 Un "learning path" para crear programas de inteligencia artificial (AI) basados en modelos de internet con Python puede ser emocionante y gratificante. A continuación, te proporciono un camino de aprendizaje con pasos y recursos recomendados para que puedas adentrarte en el mundo de la inteligencia artificial:   Nivel 1: Fundamentos de Python y Machine Learning   1. Aprende Python:    - Comienza por aprender Python, ya que es el lenguaje de programación más utilizado en la comunidad de inteligencia artificial.    - Recomendación: Codecademy, Python.org, libros de Python como "Automate the Boring Stuff with Python" de Al Sweigart.   2. Introducción a Machine Learning:    - Familiarízate con los conceptos básicos de machine learning.    - Recomendación: Curso "Machine Learning" de Andrew Ng en Coursera o el libro "Introduction to Machine Learning with Python" de Andreas C. Müller y Sarah Guido.   Nivel 2: Bibliotecas y Fram...