Skip to content

Commit

Permalink
feat: Refactor Repo and code - DocGenius AI
Browse files Browse the repository at this point in the history
  • Loading branch information
thammuio committed Dec 29, 2023
1 parent 35b6c8b commit 8d1020f
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _scripts/
notebooks/
workflows/
.github/workflows

old-app.py

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
44 changes: 22 additions & 22 deletions .project-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: DocGenius AI Chatbot Powered by CML
name: DocGenius AI - Generative AI Chatbot
description: |
Generative AI Chatbot for your Documentation
Generative AI Chatbot for your Documents Powered by CML
author: Suri Nuthalapati
specification_version: 0.3
prototype_version: 0.3
specification_version: 0.4
prototype_version: 0.4
date: "2023-11-22"

environment_variables:
Expand Down Expand Up @@ -35,7 +35,7 @@ tasks:
- type: run_session
name: Validate GPU Availibility
script: session/resource-validation/check_gpu_resources.py
short_summary: Check for GPU availibility.
short_summary: Check for GPU availibility in your Environment
long_summary: Check GPUs are enabled on this workspace and are currently schedulable.
kernel: python3
cpu: 2
Expand All @@ -44,8 +44,8 @@ tasks:
- type: run_session
name: Validate GPU Capability
script: session/resource-validation/check_gpu_capability.py
short_summary: Check for GPU capability.
long_summary: Check GPU device supports the CUDA capabilities required.
short_summary: Check for GPU capability in your Environment
long_summary: Check GPU device supports the CUDA capabilities required
kernel: python3
cpu: 4
memory: 16
Expand All @@ -54,15 +54,15 @@ tasks:
- type: run_session
name: Install Dependencies
script: session/install-deps/install_general_deps.py
short_summary: Install Dependencies
short_summary: Install Dependencies for your Project
kernel: python3
cpu: 4
memory: 16

- type: run_session
name: Install LLaMA Dependencies
script: session/install-deps/install_llama_deps.py
short_summary: Install LLaMA Dependencies
name: Install Model Dependencies
script: session/install-deps/install_model_deps.py
short_summary: Install LLM Model Dependencies
kernel: python3
cpu: 2
memory: 8
Expand All @@ -82,7 +82,7 @@ tasks:

- type: run_job
entity_label: milvus_ingestion
short_summary: Populate Milvus Vector DB with documents embeddings
short_summary: Populate Milvus Vector DB with document embeddings

- type: create_job
name: Populate Pinecone Vector DB with documents embeddings
Expand All @@ -98,22 +98,22 @@ tasks:

- type: run_job
entity_label: pinecone_ingestion
short_summary: Populate Pinecone Vector DB with documents embeddings (This will only run if you set "PINECONE" as the Vector DB and provided valid parameters.)
short_summary: Populate Pinecone Vector DB with document embeddings (This will only run if you set "PINECONE" as the Vector DB and provided valid parameters.)

- type: start_application
name: Chatbot API for Cloudera Docs
subdomain: chatbotapi
name: API for Chatbot - DocGenuis AI
subdomain: docgenius-api
script: app/main.py
short_summary: Create and Start Chatbot API
long_summary: Create and start API for Llama2 application. Ensure available GPUs for best performance. Remember to enable unauthenticated app access for external access to the UI.
short_summary: Start API for DocGenuis AI Chatbot
long_summary: Start and Publish API for DocGenius AI. Ensure available GPUs for best performance. Remember to enable unauthenticated app access for external access to the UI.
cpu: 4
memory: 16
gpu: 1
environment_variables:
TASK_TYPE: START_APPLICATION

- type: create_job
name: Build Chatbot UI
name: Build Chatbot UI Code
entity_label: setup_chatui
script: chat-ui/setup.py
arguments: None
Expand All @@ -129,11 +129,11 @@ tasks:
short_summary: Build Chatbot UI Code

- type: start_application
name: Chatbot UI for Cloudera Docs
subdomain: chatbotui
name: Frontend UI - DocGenius AI
subdomain: docgenius-ui
script: chat-ui/app.py
short_summary: Start Chatbot UI
long_summary: This task will run Flask app to serve the UI code
short_summary: Start frontend UI for DocGenuis AI Chatbot
long_summary: This task will run Flask app to serve the Chatbot Frontend UI. Remember to enable unauthenticated app access for external access to the UI.
cpu: 2
memory: 8
environment_variables:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Chatbot for Cloudera Documentation
# DocGenius AI - Generative AI Chatbot for your Documents


## Building your custom knowledge base
Expand Down
4 changes: 2 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def create_app():
CORSMiddleware,
allow_origins = [
"*",
f"https://chatbotapi.{CDSW_DOMAIN}",
f"https://chatbotui.{CDSW_DOMAIN}",
f"https://docgenius-api.{CDSW_DOMAIN}",
f"https://docgenius-ui.{CDSW_DOMAIN}",
f"https://{CDSW_DOMAIN}",
f"https://*.{CDSW_DOMAIN}",
f"*.{CDSW_DOMAIN}",
Expand Down
14 changes: 7 additions & 7 deletions catalog.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: DocGenius AI Chatbot Powered by CML
name: DocGenius AI - Generative AI Chatbot Powered by CML

entries:
- title: DocGenius AI Chatbot Powered by CML
label: chat-cloudera-docs
short_description: Generative AI Chatbot for your Documentation powered by Cloudera Machine Learning
- title: DocGenius AI - Generative AI Chatbot Powered by CML
label: doc-genius-ai
short_description: Generative AI Chatbot for your Documents powered by Cloudera Machine Learning
long_description: >-
GenAI LLM Chatbot for Cloudera Documentation powered by Cloudera Machine Learning
Generative AI Chatbot for your Documents powered by Cloudera Machine Learning
image_path: >-
https://raw.githubusercontent.com/thammuio/chat-cloudera-docs/main/images/chatbot-cloudera-docs.png
https://raw.githubusercontent.com/thammuio/doc-genius-ai/main/images/chatbot-cloudera-docs.png
tags:
- Cloudera
- Cloudera MAchine Learning
- GenAI
- LLM
- Clouder Docs
- Chatbot
git_url: "https://github.com/thammuio/chat-cloudera-docs.git"
git_url: "https://github.com/thammuio/doc-genius-ai.git"
is_prototype: true
4 changes: 2 additions & 2 deletions chat-ui/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const domain = process.env.NEXT_PUBLIC_CHATBOT_API_DOMAIN;
const api = `https://chatbotapi.${domain}`;
const origin = `https://chatbotui.${domain}`;
const api = `https://docgenius-api.${domain}`;
const origin = `https://docgenius-ui.${domain}`;
6 changes: 3 additions & 3 deletions chat-ui/src/app/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function RootLayout({ children }) {
<html lang="en" suppressHydrationWarning>
<head>
<title>DocGenius AI Chatbot Powered by CML</title>
<link rel="shortcut icon" href="https://raw.githubusercontent.com/thammuio/chat-cloudera-docs/main/chat-ui/src/images/favicon.ico" />
<link rel="shortcut icon" href="https://raw.githubusercontent.com/thammuio/doc-genius-ai/main/chat-ui/src/images/favicon.ico" />
<meta
name="description"
content="Generative AI Chatbot for your Documentation"
Expand All @@ -27,14 +27,14 @@ export default function RootLayout({ children }) {
property="og:description"
content="Generative AI Chatbot for your Documentation"
/>
<meta property="og:image" content="https://raw.githubusercontent.com/thammuio/chat-cloudera-docs/main/images/chatbot-cloudera-docs.png" />
<meta property="og:image" content="https://raw.githubusercontent.com/thammuio/doc-genius-ai/main/images/chatbot-cloudera-docs.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="DocGenius AI Chatbot" />
<meta
name="twitter:description"
content="Generative AI Chatbot for your Documentation"
/>
<meta name="twitter:image" content="https://raw.githubusercontent.com/thammuio/chat-cloudera-docs/main/images/chatbot-cloudera-docs.png" />
<meta name="twitter:image" content="https://raw.githubusercontent.com/thammuio/doc-genius-ai/main/images/chatbot-cloudera-docs.png" />
</head>
<body className={`${inter.className} bg-slate-50`}>
<ChatProvider>
Expand Down
4 changes: 2 additions & 2 deletions chat-ui/src/provider/ChatProvider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default function ChatProvider({ children }) {
const [maxTokens, setMaxTokens] = useState(100);
const [isFinishedConversation, setIsFinishedConversation] = useState(false);
const domain = process.env.NEXT_PUBLIC_CHATBOT_API_DOMAIN;
const api = `https://chatbotapi.${domain}`;
const origin = `https://chatbotui.${domain}`;
const api = `https://docgenius-api.${domain}`;
const origin = `https://docgenius-ui.${domain}`;


useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import sys

# Define the path to the shell script
script_path = "session/install-deps/install_llama_deps.sh"
llama_deps_script_path = "session/install-deps/install_llama_deps.sh"

try:
# Run the shell script
result = subprocess.run(["sh", script_path], capture_output=True, text=True, check=True)
result = subprocess.run(["sh", llama_deps_script_path], capture_output=True, text=True, check=True)

# Print the output
print("Output:", result.stdout)
Expand Down

0 comments on commit 8d1020f

Please sign in to comment.