Skip to content

Instantly share code, notes, and snippets.

View rajivmehtaflex's full-sized avatar
🚀
smile

Rajiv Mehta rajivmehtaflex

🚀
smile
  • Bacancy Technology
  • Ahmedabad
View GitHub Profile
@rajivmehtaflex
rajivmehtaflex / LangTrace-Example.md
Last active July 27, 2024 11:44
About LangTrace

url::Langtrace

pip install langtrace-python-sdk

Must precede any llm module imports

from langtrace_python_sdk import langtrace langtrace.init(api_key = 'd14167f87f6d8eefc3fcdd1acd9ef3eda021bcb95f83f2b4448556cc324507e4')

from langtrace_python_sdk import langtrace

@rajivmehtaflex
rajivmehtaflex / Api_enabled_Gradio.py
Last active August 5, 2024 12:04
HF+ZeroGPU+OpenAI-Prox+Gradio Operation
import gradio as gr
# Define a simple function
def add_numbers(a, b):
return a + b
# Create a Gradio interface
iface = gr.Interface(fn=add_numbers, inputs=["number", "number"], outputs="number")
# Launch the interface with API enabled
@rajivmehtaflex
rajivmehtaflex / requirements.txt
Last active July 13, 2024 12:23
HuggingFace Agentic Flow
abacusai
datasets
huggingface_hub
langchain
sentence-transformers
faiss-cpu
serpapi
google-search-results
openai
langchain
@rajivmehtaflex
rajivmehtaflex / Internet_search_with_Agentic.md
Created July 10, 2024 13:27
Apply Live information to Agent

Here's the converted text block organized into task-wise categories in Markdown format:

Installing and Configuring Conda

- conda config --set auto_activate_base false
- conda create --name gptexp python=3.10 -y
- conda activate gptexp
@rajivmehtaflex
rajivmehtaflex / Quick_Chatbot_Deployment.txt
Created June 29, 2024 04:31
Quick Chatbot Deployment
pip install huggingface-hub gradio llama-cpp-python \\n--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
huggingface-cli login
mkdir models
cd models
huggingface-cli download Qwen/Qwen2-0.5B-Instruct-GGUF \\nqwen2-0_5b-instruct-q5_k_m.gguf \\n--local-dir . --local-dir-use-symlinks False
cd ..
touch server.py
References link
https://www.youtube.com/watch?v=PuHP3kktmQI&list=LL
https://github.com/dmagda/openai-cookbook/blob/main/examples/vector_databases/postgresql/getting_started_with_postgresql_pgvector.ipynb
##---------------------
FROM postgres:latest
# Install the plpython3u extension
@rajivmehtaflex
rajivmehtaflex / Groq
Last active July 24, 2024 03:51
SGPT-Settings
CHAT_CACHE_PATH=/var/folders/js/sr76kddd4c71st4s75jlj5fc0000gn/T/chat_cache
CACHE_PATH=/var/folders/js/sr76kddd4c71st4s75jlj5fc0000gn/T/cache
CHAT_CACHE_LENGTH=100
CACHE_LENGTH=100
REQUEST_TIMEOUT=60
DEFAULT_MODEL=llama3-70b-8192
DEFAULT_COLOR=magenta
ROLE_STORAGE_PATH=/Users/rajivmehtapy/.config/shell_gpt/roles
DEFAULT_EXECUTE_SHELL_CMD=false
DISABLE_STREAMING=false
@rajivmehtaflex
rajivmehtaflex / Function_Call_Formula.ipynb
Last active August 1, 2024 05:17
This GIST conain Langchain related references.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rajivmehtaflex
rajivmehtaflex / Mount s3 with sdd
Last active June 13, 2024 11:00
All AWS Related gist
brew install awscli
aws configure
aws s3 ls
sudo apt install s3fs tree -y && mkdir s3data && s3fs incite-client-data ./s3data
cd s3data/
ls -alr
apt install tree
tree
@rajivmehtaflex
rajivmehtaflex / HF_TO_OLLAMA_WITH_Quantization.txt
Last active December 18, 2024 06:54
huggingface to ollama conversion with quantization
mkdir ollama-quntization
cd ollama-quntization/
bash <(curl -sSL https://g.bodaay.io/hfd) -h
./hfdownloader -m TinyLlama/TinyLlama-1.1B-Chat-v1.0
sudo apt install tree
tree
touch Modelfile
ollama create -f Modelfile tinyllama
ollama cp tinyllama rajivmehtapy/tinyllama
ollama list