Spaces:
Runtime error
Runtime error
Commit
·
13633ff
1
Parent(s):
4577e9a
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,17 +24,11 @@ import time
|
|
| 24 |
|
| 25 |
from huggingface_hub import hf_hub_download
|
| 26 |
|
| 27 |
-
|
| 28 |
#hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./reviews.csv")
|
| 29 |
|
| 30 |
from huggingface_hub import login
|
| 31 |
from datasets import load_dataset
|
| 32 |
|
| 33 |
-
from gradio_client import Client
|
| 34 |
-
|
| 35 |
-
#dataset = load_dataset("csv", data_files="./data.csv")
|
| 36 |
-
|
| 37 |
-
|
| 38 |
DB_FILE = "./reviewsitrg.db"
|
| 39 |
|
| 40 |
TOKEN = os.environ.get('HF_KEY')
|
|
@@ -99,11 +93,13 @@ def ccogsphere(name: str, rate: str, celsci: str):
|
|
| 99 |
"Views" : [500, 2000, 540, 300, 200],
|
| 100 |
"Duration" : [30, 20, 70, 35, 22]})
|
| 101 |
name1=name.split()
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
|
|
|
|
|
|
| 105 |
mess="No messages..."
|
| 106 |
-
|
| 107 |
nam="No name, write your name followed by a message"
|
| 108 |
mess="No messages, write your name followed by a message"
|
| 109 |
celscix2="End"
|
|
@@ -186,9 +182,7 @@ def load_data2():
|
|
| 186 |
db = sqlite3.connect(DB_FILE)
|
| 187 |
reviews2, total_reviews2 = get_latest_reviews2(db)
|
| 188 |
db.close()
|
| 189 |
-
return reviews2, total_reviews2
|
| 190 |
-
def echo(message, history):
|
| 191 |
-
return message
|
| 192 |
css="footer {visibility: hidden}"
|
| 193 |
# Applying style to highlight the maximum value in each row
|
| 194 |
#styler = df.style.highlight_max(color = 'lightgreen', axis = 0)
|
|
@@ -257,5 +251,5 @@ scheduler2.start()
|
|
| 257 |
scheduler3 = BackgroundScheduler()
|
| 258 |
scheduler3.add_job(func=backup_db_csv, trigger="interval", seconds=3666)
|
| 259 |
scheduler3.start()
|
| 260 |
-
|
| 261 |
demo.launch()
|
|
|
|
| 24 |
|
| 25 |
from huggingface_hub import hf_hub_download
|
| 26 |
|
|
|
|
| 27 |
#hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./reviews.csv")
|
| 28 |
|
| 29 |
from huggingface_hub import login
|
| 30 |
from datasets import load_dataset
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
DB_FILE = "./reviewsitrg.db"
|
| 33 |
|
| 34 |
TOKEN = os.environ.get('HF_KEY')
|
|
|
|
| 93 |
"Views" : [500, 2000, 540, 300, 200],
|
| 94 |
"Duration" : [30, 20, 70, 35, 22]})
|
| 95 |
name1=name.split()
|
| 96 |
+
try:
|
| 97 |
+
nam=name1[0]
|
| 98 |
+
mess=name
|
| 99 |
+
if name[1]==None:
|
| 100 |
+
nam="you wrote no messages..."
|
| 101 |
mess="No messages..."
|
| 102 |
+
except:
|
| 103 |
nam="No name, write your name followed by a message"
|
| 104 |
mess="No messages, write your name followed by a message"
|
| 105 |
celscix2="End"
|
|
|
|
| 182 |
db = sqlite3.connect(DB_FILE)
|
| 183 |
reviews2, total_reviews2 = get_latest_reviews2(db)
|
| 184 |
db.close()
|
| 185 |
+
return reviews2, total_reviews2
|
|
|
|
|
|
|
| 186 |
css="footer {visibility: hidden}"
|
| 187 |
# Applying style to highlight the maximum value in each row
|
| 188 |
#styler = df.style.highlight_max(color = 'lightgreen', axis = 0)
|
|
|
|
| 251 |
scheduler3 = BackgroundScheduler()
|
| 252 |
scheduler3.add_job(func=backup_db_csv, trigger="interval", seconds=3666)
|
| 253 |
scheduler3.start()
|
| 254 |
+
|
| 255 |
demo.launch()
|