seanpedrickcase
commited on
Commit
•
7bdc986
1
Parent(s):
651ef78
Assigned AWS bucket name to environmental variable
Browse files- app.py +2 -2
- search_funcs/aws_functions.py +4 -5
app.py
CHANGED
@@ -128,7 +128,7 @@ depends on factors such as the type of documents or queries. Information taken f
|
|
128 |
with gr.Tab(label="Advanced options"):
|
129 |
with gr.Accordion(label="Data load / save options", open = True):
|
130 |
with gr.Row():
|
131 |
-
in_clean_data = gr.Dropdown(label = "Clean text during load (remove html tags). For large files this may take some time!", value="
|
132 |
return_intermediate_files = gr.Dropdown(label = "Return intermediate processing files from file preparation. Files can be loaded in to save processing time in future.", value="No", choices=["Yes", "No"])
|
133 |
embedding_super_compress = gr.Dropdown(label = "Round embeddings to three dp for smaller files with less accuracy.", value="Yes", choices=["Yes", "No"])
|
134 |
#save_clean_data_button = gr.Button(value = "Save loaded data to file", scale = 1)
|
@@ -157,7 +157,7 @@ depends on factors such as the type of documents or queries. Information taken f
|
|
157 |
in_join_column = gr.Dropdown(label="Column to join in new data frame")
|
158 |
search_df_join_column = gr.Dropdown(label="Column to join in search data frame")
|
159 |
with gr.Accordion(label = "AWS data access", open = False):
|
160 |
-
aws_password_box = gr.Textbox(label="Password for AWS data access (ask Data team if you don't have this)")
|
161 |
with gr.Row():
|
162 |
in_aws_keyword_file = gr.Dropdown(label="Choose keyword file to load from AWS (only valid for API Gateway app)", choices=["None", "Bioasq - Biomedical example data - keyword search"])
|
163 |
load_aws_keyword_data_button = gr.Button(value="Load keyword data from AWS", variant="secondary")
|
|
|
128 |
with gr.Tab(label="Advanced options"):
|
129 |
with gr.Accordion(label="Data load / save options", open = True):
|
130 |
with gr.Row():
|
131 |
+
in_clean_data = gr.Dropdown(label = "Clean text during load (remove html tags). For large files this may take some time!", value="No", choices=["Yes", "No"])
|
132 |
return_intermediate_files = gr.Dropdown(label = "Return intermediate processing files from file preparation. Files can be loaded in to save processing time in future.", value="No", choices=["Yes", "No"])
|
133 |
embedding_super_compress = gr.Dropdown(label = "Round embeddings to three dp for smaller files with less accuracy.", value="Yes", choices=["Yes", "No"])
|
134 |
#save_clean_data_button = gr.Button(value = "Save loaded data to file", scale = 1)
|
|
|
157 |
in_join_column = gr.Dropdown(label="Column to join in new data frame")
|
158 |
search_df_join_column = gr.Dropdown(label="Column to join in search data frame")
|
159 |
with gr.Accordion(label = "AWS data access", open = False):
|
160 |
+
aws_password_box = gr.Textbox(label="Password for AWS data access (ask the Data team if you don't have this)")
|
161 |
with gr.Row():
|
162 |
in_aws_keyword_file = gr.Dropdown(label="Choose keyword file to load from AWS (only valid for API Gateway app)", choices=["None", "Bioasq - Biomedical example data - keyword search"])
|
163 |
load_aws_keyword_data_button = gr.Button(value="Load keyword data from AWS", variant="secondary")
|
search_funcs/aws_functions.py
CHANGED
@@ -6,17 +6,16 @@ import os
|
|
6 |
|
7 |
PandasDataFrame = Type[pd.DataFrame]
|
8 |
|
9 |
-
bucket_name = '
|
10 |
-
|
11 |
-
# Create a Session with the IAM role ARN
|
12 |
-
aws_role = 'arn:aws:iam::460501890304:role/ecsTaskExecutionRole'
|
13 |
|
14 |
try:
|
15 |
session = boto3.Session(profile_name="default")
|
16 |
except Exception as e:
|
17 |
print(e)
|
18 |
|
19 |
-
#sts = session.client("sts")
|
|
|
|
|
20 |
# response = sts.assume_role(
|
21 |
# RoleArn=aws_role,
|
22 |
# RoleSessionName="ecs-test-session"
|
|
|
6 |
|
7 |
PandasDataFrame = Type[pd.DataFrame]
|
8 |
|
9 |
+
bucket_name = os.environ['DATA_TEXT_SEARCH_BUCKET']
|
|
|
|
|
|
|
10 |
|
11 |
try:
|
12 |
session = boto3.Session(profile_name="default")
|
13 |
except Exception as e:
|
14 |
print(e)
|
15 |
|
16 |
+
# sts = session.client("sts")
|
17 |
+
# Create a Session with the IAM role ARN
|
18 |
+
# aws_role = os.environ['AWS_ROLE_DATA_TEXT_SEARCH']
|
19 |
# response = sts.assume_role(
|
20 |
# RoleArn=aws_role,
|
21 |
# RoleSessionName="ecs-test-session"
|