Canstralian commited on
Commit
eb06dda
·
verified ·
1 Parent(s): de52407

Update app.py

Browse files

## Key Updates:
Dataset Selection for Fine-Tuning:

Added a dropdown (st.selectbox) to choose from the listed OSINT datasets.
Once a dataset is selected, it's loaded and displayed.
Integrated Fine-Tuning Process:

The model fine-tuning logic remains the same, but it now works with the selected dataset.
Smooth Integration:

The OSINT tools (GitHub analysis, URL fetcher) and dataset/model fine-tuning sections are smoothly integrated into the app, allowing users to work with both data and OSINT tools within a single interface.

Files changed (1) hide show
  1. app.py +22 -1
app.py CHANGED
@@ -59,7 +59,8 @@ def fetch_page_title(url):
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,18 +81,38 @@ 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:
92
  df = pd.read_csv(dataset_file)
93
  st.dataframe(df.head())
94
 
 
95
  st.write("Select a model for fine-tuning:")
96
  model_name = st.selectbox("Model", ["bert-base-uncased", "distilbert-base-uncased"])
97
  if st.button("Fine-tune Model"):
 
59
  # Main Streamlit app
60
  def main():
61
  st.title("OSINT Tool")
62
+
63
+ # OSINT Repository Analysis
64
  st.write("### GitHub Repository OSINT Analysis")
65
  st.write("Enter the GitHub repository owner and name:")
66
 
 
81
  st.write(f"Last Commit: {last_commit}")
82
  st.write(f"Workflow Status: {workflow_status}")
83
 
84
+ # URL Title Fetcher
85
  st.write("### URL Title Fetcher")
86
  url = st.text_input("Enter a URL to fetch its title:")
87
  if url:
88
  title = fetch_page_title(url)
89
  st.write(f"Title: {title}")
90
 
91
+ # Dataset Upload & Model Fine-Tuning
92
  st.write("### Dataset Upload & Model Fine-Tuning")
93
+ st.write("#### Available OSINT Datasets for Fine-Tuning:")
94
+ osint_datasets = [
95
+ "gonferspanish/OSINT",
96
+ "Inforensics/missing-persons-clue-analysis-osint",
97
+ "jester6136/osint",
98
+ "originalbox/osint"
99
+ ]
100
+
101
+ selected_dataset = st.selectbox("Choose a dataset for fine-tuning:", osint_datasets)
102
+ dataset = load_dataset(selected_dataset)
103
+
104
+ # Display dataset
105
+ st.write(f"Dataset {selected_dataset} loaded successfully!")
106
+ st.write(f"First few records:")
107
+ st.write(dataset['train'].head())
108
+
109
+ # Upload CSV for fine-tuning
110
  dataset_file = st.file_uploader("Upload a CSV file for fine-tuning", type=["csv"])
111
  if dataset_file:
112
  df = pd.read_csv(dataset_file)
113
  st.dataframe(df.head())
114
 
115
+ # Fine-tuning Model Selection
116
  st.write("Select a model for fine-tuning:")
117
  model_name = st.selectbox("Model", ["bert-base-uncased", "distilbert-base-uncased"])
118
  if st.button("Fine-tune Model"):