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 / install_terraform.sh
Created September 18, 2024 08:53
terraform installation script
#!/bin/bash
# install_terraform.sh
# Exit immediately if a command exits with a non-zero status
set -e
# Update the package index
echo "Updating package index..."
sudo apt-get update
@rajivmehtaflex
rajivmehtaflex / LLM_tool_call_any_LLM.py
Created August 10, 2024 14:11
Base Tool Calling process.
import ollama
import json
show_message_tool: dict = {
"name": "show_message",
"description": "Display a greeting message with the given parameter",
"parameters": [
{
"name": "param",
"description": "The parameter to include in the greeting message",
@rajivmehtaflex
rajivmehtaflex / sqlitevec_exp.py
Created August 4, 2024 12:37
a vector search SQLite extension
# %%
# !pip install sqlite-vec
### [Ref Link](https://alexgarcia.xyz/blog/2024/sqlite-vec-stable-release/index.html)
import sqlite3
import sqlite_vec
import numpy as np
import struct
@rajivmehtaflex
rajivmehtaflex / KeyBoard-shortcut.txt
Last active August 3, 2024 12:37
IPython-VSCode-Base-Suggestion
In Visual Studio Code, the keyboard shortcuts to move to the previous (and next) cursor location are:
For Windows and Linux:
Go to previous location: Ctrl + Alt + - (minus)
Go to next location: Ctrl + Shift + - (minus)
For macOS:
Go to previous location: Ctrl + - (minus)
Go to next location: Ctrl + Shift + - (minus)
@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
@rajivmehtaflex
rajivmehtaflex / Abacus.ai.txt
Last active July 11, 2024 04:35
Abacus AI References.
give me hello-world style code for call language model for gpt-4o.I'm talking about evaluate_prompt base example
User Icon
To call a language model for GPT-4O using the evaluate_prompt method, you can use the following example code in Python:
!pip install abacusai
!pip install fsspec
!pip install s3fs
from abacusai import ApiClient