Canstralian commited on
Commit
8b63b05
·
verified ·
1 Parent(s): c1a4678

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -7
app.py CHANGED
@@ -1,14 +1,25 @@
1
  import gradio as gr
2
- from huggingface_hub import hf_hub_download
3
 
4
- # Specify the model you want to use
5
  model_id = "Canstralian/CySec_Known_Exploit_Analyzer"
6
 
7
- # Assuming the model is a pipeline or has an interface, you can load it like this:
8
- # (This might need adjustment depending on the exact model type)
9
 
10
- # Load the model and interface from Hugging Face Hub
11
- model = gr.Interface.load(f"huggingface/{model_id}")
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  # Launch the Gradio interface
14
- model.launch()
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ # Specify the model ID
5
  model_id = "Canstralian/CySec_Known_Exploit_Analyzer"
6
 
7
+ # Load the model using Hugging Face's pipeline (adjust if needed)
8
+ analyzer = pipeline("text-classification", model=model_id)
9
 
10
+ # Define a function to process inputs using the model
11
+ def analyze_exploit(text):
12
+ result = analyzer(text)
13
+ return result
14
+
15
+ # Create a Gradio interface
16
+ interface = gr.Interface(
17
+ fn=analyze_exploit,
18
+ inputs=gr.Textbox(lines=2, placeholder="Enter exploit description..."),
19
+ outputs="json",
20
+ title="CySec Known Exploit Analyzer",
21
+ description="Analyze known cybersecurity exploits using a Hugging Face model."
22
+ )
23
 
24
  # Launch the Gradio interface
25
+ interface.launch()