ghengx commited on
Commit
36e015d
·
1 Parent(s): 964a15c
Files changed (4) hide show
  1. __init__.py +0 -0
  2. app.py +18 -0
  3. dataset_loader.py +16 -0
  4. requirements.txt +73 -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="Promotion Generator",
15
+ description="""This is a demo bot to generate a promotion in JSON format."""
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/promotion_generator",
12
+ token=True
13
+ )
14
+ repo.git_pull()
15
+
16
+ load_dataset()
requirements.txt ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==23.2.1
2
+ altair==5.3.0
3
+ annotated-types==0.6.0
4
+ anyio==4.3.0
5
+ attrs==23.2.0
6
+ boto3==1.34.85
7
+ botocore==1.34.85
8
+ certifi==2024.2.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
+ fastapi==0.110.1
15
+ ffmpy==0.3.2
16
+ filelock==3.13.4
17
+ fonttools==4.51.0
18
+ fsspec==2024.3.1
19
+ gradio==4.26.0
20
+ gradio_client==0.15.1
21
+ h11==0.14.0
22
+ httpcore==1.0.5
23
+ httpx==0.27.0
24
+ huggingface-hub==0.22.2
25
+ idna==3.7
26
+ importlib_resources==6.4.0
27
+ install==1.3.5
28
+ Jinja2==3.1.3
29
+ jmespath==1.0.1
30
+ jsonschema==4.21.1
31
+ jsonschema-specifications==2023.12.1
32
+ kiwisolver==1.4.5
33
+ markdown-it-py==3.0.0
34
+ MarkupSafe==2.1.5
35
+ matplotlib==3.8.4
36
+ mdurl==0.1.2
37
+ numpy==1.26.4
38
+ openai==1.20.0
39
+ orjson==3.10.1
40
+ packaging==24.0
41
+ pandas==2.2.2
42
+ pandasql==0.7.3
43
+ pillow==10.3.0
44
+ pydantic==2.7.0
45
+ pydantic_core==2.18.1
46
+ pydub==0.25.1
47
+ Pygments==2.17.2
48
+ pyparsing==3.1.2
49
+ python-dateutil==2.9.0.post0
50
+ python-multipart==0.0.9
51
+ pytz==2024.1
52
+ PyYAML==6.0.1
53
+ referencing==0.34.0
54
+ requests==2.31.0
55
+ rich==13.7.1
56
+ rpds-py==0.18.0
57
+ ruff==0.3.7
58
+ s3transfer==0.10.1
59
+ semantic-version==2.10.0
60
+ shellingham==1.5.4
61
+ six==1.16.0
62
+ sniffio==1.3.1
63
+ SQLAlchemy==2.0.29
64
+ starlette==0.37.2
65
+ tomlkit==0.12.0
66
+ toolz==0.12.1
67
+ tqdm==4.66.2
68
+ typer==0.12.3
69
+ typing_extensions==4.11.0
70
+ tzdata==2024.1
71
+ urllib3==2.2.1
72
+ uvicorn==0.29.0
73
+ websockets==11.0.3