Skip to content

Instantly share code, notes, and snippets.

View reddgr's full-sized avatar

David González Romero reddgr

View GitHub Profile
@reddgr
reddgr / chat-with-gemma-notebook.ipynb
Last active September 11, 2024 15:32
Chat with Gemma in a notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@reddgr
reddgr / textblob-test.py
Created July 25, 2024 13:37
TextBlob for sentiment analysis. Example usage
from textblob import TextBlob
text = "As a large language model I'm proud of my ability to pass butter."
sentiment = TextBlob(text).sentiment
polarity_score = sentiment.polarity # Between -1 (negative) and 1 (positive)
subjectivity_score = sentiment.subjectivity # Between 0 (objective) and 1 (subjective)
print(text)
print(f"Polarity: {polarity_score}")
@reddgr
reddgr / check-gpu.py
Last active July 24, 2024 07:23
Testing Tensorflow GPU performance
import tensorflow as tf
import time
import matplotlib.pyplot as plt
# Checking CUDA
print("TensorFlow:", tf.__version__)
print("CUDA path:", tf.sysconfig.get_lib())
print("CUDA include path:", tf.sysconfig.get_include())
# Checking if GPU is detected: