Spaces:
Runtime error
Runtime error
Commit
·
bd813f2
1
Parent(s):
539f80e
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ from datasets import load_dataset
|
|
31 |
#dataset = load_dataset("csv", data_files="./data.csv")
|
32 |
|
33 |
|
34 |
-
DB_FILE = "./
|
35 |
|
36 |
TOKEN = os.environ.get('HF_KEY')
|
37 |
|
@@ -89,9 +89,9 @@ def ccogsphere(name: str, rate: str, celsci: str):
|
|
89 |
#try:
|
90 |
celsci1=celsci.split()
|
91 |
celsci2=celsci1[0] + "+" + celsci1[1]
|
92 |
-
if celsci=="Celscis List":
|
93 |
-
|
94 |
-
|
95 |
else:
|
96 |
celsci2=ecf(celsci2)
|
97 |
df=pd.DataFrame.from_dict(celsci2["videos"])
|
@@ -182,18 +182,7 @@ with gr.Blocks() as demo:
|
|
182 |
#@rate.change(inputs=rate, outputs=name,_js="window.location.reload()")
|
183 |
#@celsci.change(inputs=celsci, outputs=rate,_js="window.location.reload()")
|
184 |
#def secwork(name):
|
185 |
-
# load_data()
|
186 |
-
with gr.Row():
|
187 |
-
with gr.Column():
|
188 |
-
#potc = gr.ChatInterface(fn=echo, examples=["hello", "hola", "merhaba"], title="Echo Bot")
|
189 |
-
#name.change(inputs=name, outputs=celsci,_js="window.location.reload()")
|
190 |
-
gr.Dataset(components=[gr.Textbox(visible=True)],
|
191 |
-
label="Text Dataset",
|
192 |
-
samples=[
|
193 |
-
["The quick brown fox jumps over the lazy dog"],
|
194 |
-
["Build & share delightful machine learning apps"]
|
195 |
-
],
|
196 |
-
)
|
197 |
def backup_db():
|
198 |
shutil.copyfile(DB_FILE, "./reviews.db")
|
199 |
db = sqlite3.connect(DB_FILE)
|
|
|
31 |
#dataset = load_dataset("csv", data_files="./data.csv")
|
32 |
|
33 |
|
34 |
+
DB_FILE = "./reviewsitrg.db"
|
35 |
|
36 |
TOKEN = os.environ.get('HF_KEY')
|
37 |
|
|
|
89 |
#try:
|
90 |
celsci1=celsci.split()
|
91 |
celsci2=celsci1[0] + "+" + celsci1[1]
|
92 |
+
if 1==2: #celsci=="Celscis List":
|
93 |
+
cursor.execute("INSERT INTO reviews(name, view, duration) VALUES(?,?,?)", [celsci1[0], " wrote: " , celsci1[1:]])
|
94 |
+
db.commit()
|
95 |
else:
|
96 |
celsci2=ecf(celsci2)
|
97 |
df=pd.DataFrame.from_dict(celsci2["videos"])
|
|
|
182 |
#@rate.change(inputs=rate, outputs=name,_js="window.location.reload()")
|
183 |
#@celsci.change(inputs=celsci, outputs=rate,_js="window.location.reload()")
|
184 |
#def secwork(name):
|
185 |
+
# load_data()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
def backup_db():
|
187 |
shutil.copyfile(DB_FILE, "./reviews.db")
|
188 |
db = sqlite3.connect(DB_FILE)
|