diff --git a/app/app_sana.py b/app/app_sana.py index 4839c25..1b905be 100755 --- a/app/app_sana.py +++ b/app/app_sana.py @@ -43,7 +43,7 @@ ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1" DEMO_PORT = int(os.getenv("DEMO_PORT", "15432")) os.environ["GRADIO_EXAMPLES_CACHE"] = "./.gradio/cache" -COUNTER_DB = os.getenv('COUNTER_DB', '.count.db') +COUNTER_DB = os.getenv("COUNTER_DB", ".count.db") device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") @@ -115,9 +115,10 @@ TEST_TIMES = 0 INFER_SPEED = 0 + def open_db(): db = sqlite3.connect(COUNTER_DB) - db.execute('CREATE TABLE IF NOT EXISTS counter(app CHARS PRIMARY KEY UNIQUE, value INTEGER)') + db.execute("CREATE TABLE IF NOT EXISTS counter(app CHARS PRIMARY KEY UNIQUE, value INTEGER)") db.execute('INSERT OR IGNORE INTO counter(app, value) VALUES("Sana", 0)') return db @@ -338,7 +339,7 @@ def generate( .gradio-container{max-width: 640px !important} h1{text-align:center} """ -with gr.Blocks(css=css, title='Sana') as demo: +with gr.Blocks(css=css, title="Sana") as demo: gr.Markdown(title) gr.HTML(DESCRIPTION) gr.DuplicateButton(