Canstralian commited on
Commit
7ca0d3a
·
verified ·
1 Parent(s): 5b964aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +47 -3
app.py CHANGED
@@ -1,9 +1,44 @@
 
1
  import streamlit as st
2
  import requests
3
  from bs4 import BeautifulSoup
4
  import pandas as pd
5
  from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer, Trainer, TrainingArguments
6
  from datasets import load_dataset, Dataset
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  # OSINT functions
9
  def get_github_stars_forks(owner, repo):
@@ -58,8 +93,15 @@ def fetch_page_title(url):
58
 
59
  # Main Streamlit app
60
  def main():
61
- st.title("OSINT Tool")
62
-
 
 
 
 
 
 
 
63
  st.write("### GitHub Repository OSINT Analysis")
64
  st.write("Enter the GitHub repository owner and name:")
65
 
@@ -80,12 +122,14 @@ def main():
80
  st.write(f"Last Commit: {last_commit}")
81
  st.write(f"Workflow Status: {workflow_status}")
82
 
 
83
  st.write("### URL Title Fetcher")
84
  url = st.text_input("Enter a URL to fetch its title:")
85
  if url:
86
  title = fetch_page_title(url)
87
  st.write(f"Title: {title}")
88
-
 
89
  st.write("### Dataset Upload & Model Fine-Tuning")
90
  dataset_file = st.file_uploader("Upload a CSV file for fine-tuning", type=["csv"])
91
  if dataset_file:
 
1
+ import yaml
2
  import streamlit as st
3
  import requests
4
  from bs4 import BeautifulSoup
5
  import pandas as pd
6
  from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer, Trainer, TrainingArguments
7
  from datasets import load_dataset, Dataset
8
+ from components.sidebar import sidebar
9
+ from components.chat_box import chat_box
10
+ from components.chat_loop import chat_loop
11
+ from components.init_state import init_state
12
+ from components.prompt_engineering_dashboard import prompt_engineering_dashboard
13
+
14
+ # Load config.yaml
15
+ with open("config.yaml", "r") as file:
16
+ config = yaml.safe_load(file)
17
+
18
+ # Streamlit page configuration
19
+ st.set_page_config(
20
+ page_title="( -_•)▄︻テ═一💥 (´༎ຶٹ༎ຶ)NCTC OSINT AGENT BY TRHACKNON ╭∩╮( •̀_•́ )╭∩╮",
21
+ page_icon="𓃮",
22
+ )
23
+
24
+ # Initialize session state
25
+ init_state(st.session_state, config)
26
+
27
+ # Custom HTML for title styling
28
+ html_title = '''
29
+ <style>
30
+ .stTitle {
31
+ color: #00008B; /* Deep blue color */
32
+ font-size: 36px; /* Adjust font size as desired */
33
+ font-weight: bold; /* Add boldness (optional) */
34
+ /* Add other font styling here (optional) */
35
+ }
36
+ </style>
37
+ <h1 class="stTitle">( -_•)▄︻テ═一💥(´༎ຶٹ༎ຶ)NCTC OSINT AGENT💥╾━╤デ╦︻(•̀⤙•́)</h1>
38
+ '''
39
+
40
+ # Display HTML title
41
+ st.write(html_title, unsafe_allow_html=True)
42
 
43
  # OSINT functions
44
  def get_github_stars_forks(owner, repo):
 
93
 
94
  # Main Streamlit app
95
  def main():
96
+ # Display Prompt Engineering Dashboard (testing phase)
97
+ prompt_engineering_dashboard(st.session_state, config)
98
+
99
+ # Display sidebar and chat box
100
+ sidebar(st.session_state, config)
101
+ chat_box(st.session_state, config)
102
+ chat_loop(st.session_state, config)
103
+
104
+ # GitHub OSINT Analysis
105
  st.write("### GitHub Repository OSINT Analysis")
106
  st.write("Enter the GitHub repository owner and name:")
107
 
 
122
  st.write(f"Last Commit: {last_commit}")
123
  st.write(f"Workflow Status: {workflow_status}")
124
 
125
+ # URL Title Fetcher
126
  st.write("### URL Title Fetcher")
127
  url = st.text_input("Enter a URL to fetch its title:")
128
  if url:
129
  title = fetch_page_title(url)
130
  st.write(f"Title: {title}")
131
+
132
+ # Dataset Upload & Model Fine-Tuning Section
133
  st.write("### Dataset Upload & Model Fine-Tuning")
134
  dataset_file = st.file_uploader("Upload a CSV file for fine-tuning", type=["csv"])
135
  if dataset_file: