tommy24 commited on
Commit
1628196
·
1 Parent(s): 99f12a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -3
app.py CHANGED
@@ -1,7 +1,23 @@
1
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
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()