ghengx commited on
Commit
cdbe5c1
1 Parent(s): c304dfb
Files changed (3) hide show
  1. __init__.py +0 -0
  2. app.py +18 -0
  3. dataset_loader.py +16 -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="Savoir Group E-commerce Stock Inquiry Demo",
15
+ description="""This is a demo bot for Savoir Group."""
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/savoir_group",
12
+ token=True
13
+ )
14
+ repo.git_pull()
15
+
16
+ load_dataset()