Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submission-ByteZen #6

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ByteZen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# .gitignore

# Exclude environment (`.env`) files
.env
7 changes: 7 additions & 0 deletions ByteZen/.streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[theme]
base="light"
primaryColor="#D6EAF8"
backgroundColor="#D6EAF8"
secondaryBackgroundColor="#85929E"
textColor="#000000"
font="serif"
Binary file added ByteZen/App/Images/imagelog.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ByteZen/App/Images/logoside.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions ByteZen/App/PATHS.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
NAVBAR_PATHS = {
'HOME':'home',
'ABOUT': 'about',
'ANALYSIS': 'analysis',
'CONTACT US': {
'FAQ': 'customer-support/faq',
'CHAT': 'customer-support/chat',
'CONTACT': 'customer-support/contact',
'TUTORIALS': 'customer-support/tutorials',
'HELP_CENTER': 'customer-support/help-center',
'BUG_REPORT': 'customer-support/bug-report'
}
}

SETTINGS = {
'OPTIONS':'options',
'CONFIGURATION':'configuration'
}
Binary file added ByteZen/App/assets/images/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions ByteZen/App/assets/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
.navbar{
font-family: 'Roboto', 'Roboto';
position: fixed;
font-weight: bold;
width: 100%;
background: #17202A;
z-index: 99999999999999999999;
left: 0rem;
top: 0rem;
height: 55px;
}

.navitem{
float: left;
font-weight: bold;
display: block;
color: #f2f2f2 !important;
text-align: center;
padding: 20px 20px;
text-decoration: none !important;
border-bottom: 2px solid transparent;
font-size: 14px;
font-family: 'Trebuchet MS', sans-serif;
}

.navitem:hover{
background-color: #333;
height: 55px !important;
}


.settings{
height:1rem;
}

.version-span{
color: white;
position: absolute;
right: 1rem;
bottom: 1.75rem;
opacity: 0.5;
z-index: 9999;
border: 2px solid #333;
border-radius: 25px;
padding-right: 0.5rem;
padding-left: 0.5rem;
background: #333;
}

.dropbtn {
background-color: transparent;
color: white;
padding: 10px;
font-size: 16px;
height: 55px;
opacity: 0.5;
filter: invert(1);
cursor: pointer;
transition: 0.3s;
}

.dropbtn:hover, .dropbtn:focus {
opacity:1;
}

.dropdown {
position: fixed;
display: inline-block;
right: 0rem;
top: 0rem;
}

.dropdown-content {
visibility: hidden;
position: fixed;
border-radius: 9px;
background-color: #333;
min-width: 160px;
overflow: auto;
right:0.3rem;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}

.dropdown-content a {
color: white;
padding: 12px 16px;
text-decoration: none;
display: block;
}

.dropbtn:hover{
background-color: rgba(221, 221, 221, 0.233);
background: rgba(221, 221, 221, 0.233);
}

.dropdown a:hover {background-color: rgba(221, 221, 221, 0.233);}

iframe{
height: 0rem;
}
34 changes: 34 additions & 0 deletions ByteZen/App/generate_response_opensourcemodel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import json
import os
import streamlit as st
from langchain.llms import CTransformers

class response_function:
@staticmethod
def generate_response(input_text, conversation_history):
intial_prompt = f"""
You are the IT Expert, dedicated to resolving technical issues.
"""
#LLM Initialization
#LLM Initialization
local_llm = "TheBloke/mistral-7b-intel-v0.1.Q4_0.gguf"

config = {
'max_new_tokens': 1024,
'repetition_penalty': 1.1,
'temperature': 0.1,
'top_k': 50,
'top_p': 0.9,
'stream': True,
'threads': int(os.cpu_count() / 2)
}

llm = CTransformers(
model=local_llm,
model_type="mistral",
lib="avx2", # for CPU use
**config
)
return response_message


23 changes: 23 additions & 0 deletions ByteZen/App/ingest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.vectorstores import Chroma
from langchain.embeddings import HuggingFaceBgeEmbeddings
from langchain.document_loaders import PyPDFLoader

model_name = "BAAI/bge-large-en"
model_kwargs = {'device': 'cpu'}
encode_kwargs = {'normalize_embeddings': False}
embeddings = HuggingFaceBgeEmbeddings(
model_name=model_name,
model_kwargs=model_kwargs,
encode_kwargs=encode_kwargs
)

loader = PyPDFLoader("RAG.pdf")
documents = loader.load()
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
texts = text_splitter.split_documents(documents)

vector_store = Chroma.from_documents(texts, embeddings, collection_metadata={"hnsw:space": "cosine"}, persist_directory="RAG/customer-support")

print("Vector Store Created.......")
Loading