Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,23 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
+
from pyrebase import pyrebase
|
4 |
+
config = {
|
5 |
+
"apiKey": os.environ.get("key"),
|
6 |
+
"authDomain": os.environ.get("domain"),
|
7 |
+
"databaseURL": os.environ.get("url"),
|
8 |
+
"projectId": os.environ.get("id"),
|
9 |
+
"storageBucket": os.environ.get("st_bk"),
|
10 |
+
"messagingSenderId": os.environ.get("sn_id"),
|
11 |
+
"appId": os.environ.get("a_id")
|
12 |
+
}
|
13 |
|
14 |
+
app = pyrebase.initialize_app(config)
|
15 |
+
db = app.database()
|
16 |
|
17 |
+
def function(parameter):
|
18 |
+
data = db.child("data").child(parameter).get()
|
19 |
+
data = data.val()
|
20 |
+
return data.val
|
21 |
+
|
22 |
+
iface = gr.Interface(fn=function, inputs="text", outputs="text")
|
23 |
iface.launch()
|