Spaces:
Sleeping
Sleeping
ghengx
commited on
Commit
•
7bae219
1
Parent(s):
0ffaaa8
init
Browse files- __init__.py +0 -0
- app.py +18 -0
- dataset_loader.py +16 -0
- requirements.txt +82 -0
__init__.py
ADDED
File without changes
|
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from dataset_loader import load_dataset
|
3 |
+
|
4 |
+
if not os.path.isdir('agent_function'):
|
5 |
+
load_dataset()
|
6 |
+
|
7 |
+
import gradio as gr
|
8 |
+
from agent_function.agent import Agent
|
9 |
+
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=Agent().ask,
|
12 |
+
inputs=gr.components.Textbox(lines=7, label="Enter your text"),
|
13 |
+
outputs="text",
|
14 |
+
title="LGMS Cybersecurity ChatBot",
|
15 |
+
description="""Understand Cybersecurity with LLM Chatbot. 1 to 1 Q&A (No memory)"""
|
16 |
+
)
|
17 |
+
|
18 |
+
iface.launch(share=False)
|
dataset_loader.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import Repository
|
2 |
+
from huggingface_hub import login
|
3 |
+
import os
|
4 |
+
|
5 |
+
def load_dataset():
|
6 |
+
login(token = os.environ['HUB_TOKEN'])
|
7 |
+
|
8 |
+
repo = Repository(
|
9 |
+
local_dir="agent_function",
|
10 |
+
repo_type="dataset",
|
11 |
+
clone_from="gheng/lgms",
|
12 |
+
token=True
|
13 |
+
)
|
14 |
+
repo.git_pull()
|
15 |
+
|
16 |
+
load_dataset()
|
requirements.txt
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiofiles==23.2.1
|
2 |
+
altair==5.3.0
|
3 |
+
annotated-types==0.7.0
|
4 |
+
anyio==4.4.0
|
5 |
+
attrs==23.2.0
|
6 |
+
boto3==1.34.121
|
7 |
+
botocore==1.34.121
|
8 |
+
certifi==2024.6.2
|
9 |
+
charset-normalizer==3.3.2
|
10 |
+
click==8.1.7
|
11 |
+
contourpy==1.2.1
|
12 |
+
cycler==0.12.1
|
13 |
+
distro==1.9.0
|
14 |
+
dnspython==2.6.1
|
15 |
+
email_validator==2.1.1
|
16 |
+
fastapi==0.111.0
|
17 |
+
fastapi-cli==0.0.4
|
18 |
+
ffmpy==0.3.2
|
19 |
+
filelock==3.14.0
|
20 |
+
fonttools==4.53.0
|
21 |
+
fsspec==2024.6.0
|
22 |
+
gradio==4.36.0
|
23 |
+
gradio_client==1.0.1
|
24 |
+
h11==0.14.0
|
25 |
+
httpcore==1.0.5
|
26 |
+
httptools==0.6.1
|
27 |
+
httpx==0.27.0
|
28 |
+
huggingface-hub==0.23.3
|
29 |
+
idna==3.7
|
30 |
+
importlib_resources==6.4.0
|
31 |
+
Jinja2==3.1.4
|
32 |
+
jmespath==1.0.1
|
33 |
+
joblib==1.4.2
|
34 |
+
jsonschema==4.22.0
|
35 |
+
jsonschema-specifications==2023.12.1
|
36 |
+
kiwisolver==1.4.5
|
37 |
+
markdown-it-py==3.0.0
|
38 |
+
MarkupSafe==2.1.5
|
39 |
+
matplotlib==3.9.0
|
40 |
+
mdurl==0.1.2
|
41 |
+
numpy==1.26.4
|
42 |
+
openai==1.32.0
|
43 |
+
orjson==3.10.3
|
44 |
+
packaging==24.0
|
45 |
+
pandas==2.2.2
|
46 |
+
pillow==10.3.0
|
47 |
+
pydantic==2.7.3
|
48 |
+
pydantic_core==2.18.4
|
49 |
+
pydub==0.25.1
|
50 |
+
Pygments==2.18.0
|
51 |
+
pyparsing==3.1.2
|
52 |
+
python-dateutil==2.9.0.post0
|
53 |
+
python-dotenv==1.0.1
|
54 |
+
python-multipart==0.0.9
|
55 |
+
pytz==2024.1
|
56 |
+
PyYAML==6.0.1
|
57 |
+
referencing==0.35.1
|
58 |
+
requests==2.32.3
|
59 |
+
rich==13.7.1
|
60 |
+
rpds-py==0.18.1
|
61 |
+
ruff==0.4.8
|
62 |
+
s3transfer==0.10.1
|
63 |
+
scikit-learn==1.5.0
|
64 |
+
scipy==1.13.1
|
65 |
+
semantic-version==2.10.0
|
66 |
+
shellingham==1.5.4
|
67 |
+
six==1.16.0
|
68 |
+
sniffio==1.3.1
|
69 |
+
starlette==0.37.2
|
70 |
+
threadpoolctl==3.5.0
|
71 |
+
tomlkit==0.12.0
|
72 |
+
toolz==0.12.1
|
73 |
+
tqdm==4.66.4
|
74 |
+
typer==0.12.3
|
75 |
+
typing_extensions==4.12.1
|
76 |
+
tzdata==2024.1
|
77 |
+
ujson==5.10.0
|
78 |
+
urllib3==2.2.1
|
79 |
+
uvicorn==0.30.1
|
80 |
+
uvloop==0.19.0
|
81 |
+
watchfiles==0.22.0
|
82 |
+
websockets==11.0.3
|