Spaces:
Sleeping
Sleeping
ablamahfadi
commited on
Commit
•
2912f80
1
Parent(s):
f09ac4a
Upload folder using huggingface_hub
Browse files- Screenshot 2023-10-04 170215.jpg +0 -0
- app.py +5 -3
- v3_0253210.jpg +0 -0
Screenshot 2023-10-04 170215.jpg
ADDED
app.py
CHANGED
@@ -2,8 +2,8 @@ import os
|
|
2 |
|
3 |
os.system("pip install awscli boto3 sagemaker gradio")
|
4 |
|
5 |
-
os.system("aws configure set aws_access_key_id
|
6 |
-
os.system("aws configure set aws_secret_access_key
|
7 |
os.system("aws configure set default.region us-east-1")
|
8 |
os.system("aws configure set default.output json")
|
9 |
|
@@ -24,7 +24,7 @@ def deploy_and_get_interface(hf_model_url):
|
|
24 |
role = sagemaker.get_execution_role()
|
25 |
except ValueError:
|
26 |
iam = boto3.client('iam')
|
27 |
-
role = iam.get_role(RoleName='
|
28 |
|
29 |
hf_model_id = hf_model_url.split('/')[-2]
|
30 |
|
@@ -52,6 +52,7 @@ def deploy_and_get_interface(hf_model_url):
|
|
52 |
iface = gr.Interface(fn=get_prediction,
|
53 |
inputs="text",
|
54 |
outputs="text",
|
|
|
55 |
title="HuggingFace Model Predictor",
|
56 |
description="Enter some text and get the model's prediction!")
|
57 |
|
@@ -66,6 +67,7 @@ def trigger_deploy(hf_model_url):
|
|
66 |
iface = gr.Interface(fn=get_prediction,
|
67 |
inputs="text",
|
68 |
outputs="text",
|
|
|
69 |
title="HuggingFace Model Predictor",
|
70 |
description="Enter some text and get the model's prediction!")
|
71 |
iface.launch()
|
|
|
2 |
|
3 |
os.system("pip install awscli boto3 sagemaker gradio")
|
4 |
|
5 |
+
os.system("aws configure set aws_access_key_id AKIAYIBNUHKT7UN3PKCK")
|
6 |
+
os.system("aws configure set aws_secret_access_key yLAC+VTSBO79q/kYfFzDxZTyL8ihsOyQRQJu/pu5")
|
7 |
os.system("aws configure set default.region us-east-1")
|
8 |
os.system("aws configure set default.output json")
|
9 |
|
|
|
24 |
role = sagemaker.get_execution_role()
|
25 |
except ValueError:
|
26 |
iam = boto3.client('iam')
|
27 |
+
role = iam.get_role(RoleName='Moh-work')['Role']['Arn']
|
28 |
|
29 |
hf_model_id = hf_model_url.split('/')[-2]
|
30 |
|
|
|
52 |
iface = gr.Interface(fn=get_prediction,
|
53 |
inputs="text",
|
54 |
outputs="text",
|
55 |
+
|
56 |
title="HuggingFace Model Predictor",
|
57 |
description="Enter some text and get the model's prediction!")
|
58 |
|
|
|
67 |
iface = gr.Interface(fn=get_prediction,
|
68 |
inputs="text",
|
69 |
outputs="text",
|
70 |
+
|
71 |
title="HuggingFace Model Predictor",
|
72 |
description="Enter some text and get the model's prediction!")
|
73 |
iface.launch()
|
v3_0253210.jpg
ADDED