Spaces:
Sleeping
Sleeping
vishal1278
commited on
Commit
•
da2170f
1
Parent(s):
25191b2
added password protection
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from utils import (
|
|
6 |
generate_dummy_data,
|
7 |
generate_summary,
|
8 |
generate_welcome_message,
|
|
|
9 |
)
|
10 |
from prompts import CAMPAIGN_DESCR
|
11 |
|
@@ -47,4 +48,4 @@ def create_gradio_app():
|
|
47 |
|
48 |
|
49 |
# Run the Gradio app
|
50 |
-
create_gradio_app()
|
|
|
6 |
generate_dummy_data,
|
7 |
generate_summary,
|
8 |
generate_welcome_message,
|
9 |
+
check_password,
|
10 |
)
|
11 |
from prompts import CAMPAIGN_DESCR
|
12 |
|
|
|
48 |
|
49 |
|
50 |
# Run the Gradio app
|
51 |
+
create_gradio_app(auth=check_password)
|
utils.py
CHANGED
@@ -10,6 +10,7 @@ from prompts import SYSTEM_PROMPT, PERSONA_DESCR, CAMPAIGN_DESCR
|
|
10 |
|
11 |
load_dotenv("../.env")
|
12 |
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
|
|
13 |
|
14 |
|
15 |
def generate_summary(customer_data):
|
@@ -119,3 +120,7 @@ def generate_dummy_data():
|
|
119 |
}
|
120 |
|
121 |
return pd.DataFrame(data)
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
load_dotenv("../.env")
|
12 |
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
13 |
+
gradio_pw = os.getenv("GRADIO_PW")
|
14 |
|
15 |
|
16 |
def generate_summary(customer_data):
|
|
|
120 |
}
|
121 |
|
122 |
return pd.DataFrame(data)
|
123 |
+
|
124 |
+
|
125 |
+
def check_passwordpw(password):
|
126 |
+
return password == gradio_pw:
|