Spaces:
Runtime error
Runtime error
shauryaDugar
commited on
Commit
•
34d45eb
1
Parent(s):
d4eddcf
Upload folder using huggingface_hub
Browse files- .gitignore +2 -0
- interface.py +14 -0
.gitignore
CHANGED
@@ -164,3 +164,5 @@ gradio_cached_examples/
|
|
164 |
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
165 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
166 |
#.idea/
|
|
|
|
|
|
164 |
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
165 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
166 |
#.idea/
|
167 |
+
|
168 |
+
demo.py
|
interface.py
CHANGED
@@ -1,5 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
from allpreds import make_preds
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
# the examples variable is a list of lists. It contains an example input in each list.
|
5 |
# for eg. here there is only one example so the size of the list 'examples' is 1
|
|
|
1 |
import gradio as gr
|
2 |
from allpreds import make_preds
|
3 |
+
import os
|
4 |
+
import tempfile
|
5 |
+
|
6 |
+
def get_credentials():
|
7 |
+
creds_json_str = os.getenv("SERVICE_ACC_KEY")
|
8 |
+
with tempfile.NamedTemporaryFile(mode="w+", delete=False, suffix=".json") as temp:
|
9 |
+
temp.write(creds_json_str)
|
10 |
+
temp_filename = temp.name
|
11 |
+
|
12 |
+
return temp_filename
|
13 |
+
|
14 |
+
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = get_credentials()
|
15 |
+
|
16 |
+
|
17 |
|
18 |
# the examples variable is a list of lists. It contains an example input in each list.
|
19 |
# for eg. here there is only one example so the size of the list 'examples' is 1
|