File size: 625 Bytes
50be483
1628196
 
 
 
 
 
 
 
 
 
 
50be483
1628196
 
50be483
1628196
 
 
 
 
 
50be483
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
import os
from pyrebase import pyrebase
config = {
    "apiKey": os.environ.get("key"),
    "authDomain": os.environ.get("domain"),
    "databaseURL": os.environ.get("url"),
    "projectId": os.environ.get("id"),
    "storageBucket": os.environ.get("st_bk"),
    "messagingSenderId": os.environ.get("sn_id"),
    "appId": os.environ.get("a_id")
}

app = pyrebase.initialize_app(config)
db = app.database()

def function(parameter):
    data = db.child("data").child(parameter).get()
    data = data.val()
    return data.val

iface = gr.Interface(fn=function, inputs="text", outputs="text")
iface.launch()