Remove Numbers-7765
title: "Remove Numbers"
author: "Raja CSP Raman"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
content = '15. TFRecord in Tensorflow'
'15. TFRecord in Tensorflow'
result = re.sub(r'\d+\.', '', content)
content2 = """1. Cross Entropy Loss Derivation
2. How to split a tensorflow model …
Read More
Remove Symbols
title: "Remove Symbols"
author: "Raja CSP Raman"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
content = "This device is costing only 12.89$. This is fantastic!"
'This device is costing only 12.89$. This is fantastic!'
re.sub(r'[^\w]', ' ', content)
'This device is costing only 12 89 …
Read More
Remove-Th-From-Date
title: "Remove th From Date"
author: "Rj"
date: 2019-04-20
description: "List Test"
type: technical_note
draft: false
from datetime import datetime
import re
content = 'Sunday, May 18th, 2019'
d = datetime.strptime(re.sub('(\d+)(st|nd|rd|th)', '\g<1>', content), '%A, %B %d, %Y')
Read More
Reshape
title: "Reshape"
author: "Raja CSP Raman"
date: 2019-05-07
description: "-"
type: technical_note
draft: false
import tensorflow as tf
import os
# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
tf.InteractiveSession()
a = tf.zeros((2, 2))
b = tf.ones((2, 2))
abc = tf.reduce_sum(b, reduction_indices=1 …
Read More
Reshape-1
title: "Reshape Extra"
author: "Raja CSP Raman"
date: 2019-05-07
description: "-"
type: technical_note
draft: false
import tensorflow as tf
import os
# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
a = tf.constant([1, 2, 3, 4, 5, 6, 7, 9])
b = tf.reshape(a, [2, 4 …
Read More
Retrieval-Chain
# https://python.langchain.com/docs/how_to/streaming/
from constants import OPENAI_API_KEY
!pip show langchain-openai | grep "Version:"
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY
from langchain_openai import ChatOpenAI
model = ChatOpenAI(model="gpt-4o-mini")
Requirement already satisfied: faiss-cpu …
Read More
Retriever-2
from constants import OPENAI_API_KEY
!pip show langchain-openai | grep "Version:"
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY
from langchain_openai import ChatOpenAI
model = ChatOpenAI(model="gpt-4o-mini")
from langchain_community.vectorstores import FAISS
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from …
Read More