Spaces:
Runtime error
Runtime error
Commit
·
b764f3e
1
Parent(s):
1302eeb
Update app.py
Browse files
app.py
CHANGED
|
@@ -109,9 +109,15 @@ def run_actr():
|
|
| 109 |
|
| 110 |
def run_ecs(inp):
|
| 111 |
result=ecf(inp)
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
def load_data():
|
| 117 |
db = sqlite3.connect(DB_FILE)
|
|
@@ -129,7 +135,6 @@ df = pd.DataFrame({
|
|
| 129 |
})
|
| 130 |
|
| 131 |
# Applying style to highlight the maximum value in each row
|
| 132 |
-
styler = df.style.highlight_max(color = 'lightgreen', axis = 0)
|
| 133 |
|
| 134 |
css="footer {visibility: hidden}"
|
| 135 |
# Applying style to highlight the maximum value in each row
|
|
@@ -137,7 +142,11 @@ css="footer {visibility: hidden}"
|
|
| 137 |
with gr.Blocks() as demo:
|
| 138 |
with gr.Row():
|
| 139 |
with gr.Column():
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
#df1=run_ecs("Dan")
|
| 142 |
|
| 143 |
|
|
|
|
| 109 |
|
| 110 |
def run_ecs(inp):
|
| 111 |
result=ecf(inp)
|
| 112 |
+
db = sqlite3.connect(DB_FILE)
|
| 113 |
+
try:
|
| 114 |
+
db.execute("SELECT * FROM reviews").fetchall()
|
| 115 |
+
db.close()
|
| 116 |
+
reviews, total_reviews = get_latest_reviews(db)
|
| 117 |
+
except sqlite3.OperationalError:
|
| 118 |
+
print ("db error")
|
| 119 |
+
return (result, reviews, total_reviews)
|
| 120 |
+
|
| 121 |
|
| 122 |
def load_data():
|
| 123 |
db = sqlite3.connect(DB_FILE)
|
|
|
|
| 135 |
})
|
| 136 |
|
| 137 |
# Applying style to highlight the maximum value in each row
|
|
|
|
| 138 |
|
| 139 |
css="footer {visibility: hidden}"
|
| 140 |
# Applying style to highlight the maximum value in each row
|
|
|
|
| 142 |
with gr.Blocks() as demo:
|
| 143 |
with gr.Row():
|
| 144 |
with gr.Column():
|
| 145 |
+
total_reviews, reviews=run_ecs("Dan")
|
| 146 |
+
df=pd.DataFrame(reviews)
|
| 147 |
+
styler = df.style.highlight_max(color = 'lightgreen', axis = 0)
|
| 148 |
+
|
| 149 |
+
gr.Dataframe(styler)
|
| 150 |
#df1=run_ecs("Dan")
|
| 151 |
|
| 152 |
|