Skip to content

Instantly share code, notes, and snippets.

View ehzawad's full-sized avatar
🎃
Wasteland Baby!

ehz ehzawad

🎃
Wasteland Baby!
View GitHub Profile
class ActionAskYaqeenFaq(Action):
def name(self) -> Text:
return "action_ask_yaqeen_faq"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
last_text = tracker.latest_message["text"]
@ehzawad
ehzawad / interactive_DFS.js
Created September 10, 2024 11:58
interactive_dfs.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>React D3.js Interactive Directed Graph Representation</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.8.6/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.6/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.16.0/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
function addSuggestion(suggestions) {
console.log("addSuggestion called with suggestions:", suggestions);
const suggLength = suggestions.length;
console.log("Number of suggestions:", suggLength);
const suggestionsHTML = `
<div class="singleCard">
<div class="suggestions">
<div class="menu"></div>
</div>
# Intermediate server (Jump Host)
Host jumphost
HostName 45.251.56.227
User root
IdentityFile ~/.ssh/id_rsa_legacy
PubkeyAuthentication yes
PasswordAuthentication yes
PreferredAuthentications publickey,password
ConnectTimeout 30
ServerAliveInterval 60
import requests
from typing import Any, Text, Dict, List
class BankAPI:
def __init__(self):
self.headers = {"Content-Type": "application/json"}
def data_validation(self, data_list):
data_list = list(map(str, data_list))
return data_list
@ehzawad
ehzawad / otp_sending.py
Created August 7, 2024 09:03
OTP-sending
# OTP Implementation Flow and Code
## 1. Generate OTP
When a sensitive operation is requested, a new OTP is generated.
```python
def opt_generator(self):
opt_number = random.randint(self.otp_srange, self.opt_erange)
return opt_number
# Cell 1: Install dependencies
!pip install -q -U transformers llama-index accelerate pypdf einops bitsandbytes
!pip install -q llama-index-llms-huggingface
!pip install -q llama-index-embeddings-huggingface
# Cell 2: Import libraries and set up warnings
import warnings
warnings.filterwarnings('ignore')
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, ServiceContext
@ehzawad
ehzawad / domain.yml
Created June 4, 2024 02:04
A sample domain.yml for managing flow
version: "3.1"
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
@ehzawad
ehzawad / train_and_inference.py
Last active June 4, 2024 02:04
simple_MNIST_reduced_for_CNN
import zipfile
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
from torchvision.datasets import ImageFolder
from torch.utils.data import DataLoader
from PIL import Image
import matplotlib.pyplot as plt
asrserver(){
ssh root@192.168.10.98
}
voicebotMTB() {
ssh -t root@192.168.10.98 "ssh -t appadm@10.45.57.103 'sudo -i'"
}
MTBproj() {