Posts

Showing posts with the label ML

Run a TensorFlow jupyter notebook on docker

Image
 This is getting started guide for ML beginners who wants to use Jupyter Notebook on Docker environment. Docker is a way to use different development environments and frameworks without physically install them on your PC or workstation. For more information, please visit docker website.

How to run HugginFace models in Python

  Hugging Face Hugging face is a machine learning community where you can share pre trained models and explore other trained models, which are suited for many use cases. Many of the models already trained well and ready to use. Without delay get started! Python setup Open your Jupiter notebook or for easy startup without python installation on local machine, use Colab . In this example we are using mistralai/Mistral-7B-v0.1 model. Let's install the transformers module which is the primary dependency for HuggingFace.   conda install transformers Following script will work like a charm . # mistrel model test from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "mistralai/Mistral-7B-v0.1" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(model_id) text = "Hello my name is" inputs = tokenizer(text, return_tensors="pt") outputs = model.generate(**inputs, max_new_tokens=20) print(tokenizer.d...

Using Image url in Keras image classification

Image
  How to load an image in Keras for machine learning from a url ?

Get predicted class name in Keras Sequential Model

 In Keras Sequential Model problems we can get predicted result as output. As a beginner you may note that it is not what you expected. So how do we get the actual label for that image.?