Bohaska
commited on
Commit
·
d8c1b03
1
Parent(s):
cb6590e
add gradio
Browse files- main.py → app.py +9 -0
- requirements.txt +2 -1
main.py → app.py
RENAMED
|
@@ -7,6 +7,7 @@ import manifold_arkpoint
|
|
| 7 |
from rac_bot import bot
|
| 8 |
import nationstates_main
|
| 9 |
from ballsdex_hash import hash_balldex_images
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
|
|
@@ -16,15 +17,23 @@ logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %
|
|
| 16 |
executor.submit(asyncio.run, autoupdate_grades_habitica(db_client))
|
| 17 |
executor.submit(asyncio.run, bot.start(os.getenv('BOT_TOKEN')))"""
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
tasks = []
|
| 20 |
# tasks.append(Process(target=hash_balldex_images))
|
| 21 |
tasks.append(Process(target=bot.run, args=(os.getenv('BOT_TOKEN'),)))
|
| 22 |
# tasks.append(Process(target=manifold_arkpoint.bet_stock_markets, args=()))
|
| 23 |
tasks.append(Process(target=asyncio.run, args=(nationstates_main.run_all_tasks(),)))
|
| 24 |
# bet_users = Process(target=asyncio.run, args=(manifold_arkpoint.bet_users(),))
|
|
|
|
|
|
|
| 25 |
for task in tasks:
|
| 26 |
task.start()
|
| 27 |
# bet_users.start()
|
| 28 |
for task in tasks:
|
| 29 |
task.join()
|
| 30 |
# bet_users.join()
|
|
|
|
|
|
| 7 |
from rac_bot import bot
|
| 8 |
import nationstates_main
|
| 9 |
from ballsdex_hash import hash_balldex_images
|
| 10 |
+
import gradio as gr
|
| 11 |
|
| 12 |
|
| 13 |
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
|
|
|
|
| 17 |
executor.submit(asyncio.run, autoupdate_grades_habitica(db_client))
|
| 18 |
executor.submit(asyncio.run, bot.start(os.getenv('BOT_TOKEN')))"""
|
| 19 |
|
| 20 |
+
def greet(name):
|
| 21 |
+
return "Hello " + name + "!!"
|
| 22 |
+
|
| 23 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 24 |
+
|
| 25 |
tasks = []
|
| 26 |
# tasks.append(Process(target=hash_balldex_images))
|
| 27 |
tasks.append(Process(target=bot.run, args=(os.getenv('BOT_TOKEN'),)))
|
| 28 |
# tasks.append(Process(target=manifold_arkpoint.bet_stock_markets, args=()))
|
| 29 |
tasks.append(Process(target=asyncio.run, args=(nationstates_main.run_all_tasks(),)))
|
| 30 |
# bet_users = Process(target=asyncio.run, args=(manifold_arkpoint.bet_users(),))
|
| 31 |
+
tasks.append(Process(target=demo.launch))
|
| 32 |
+
|
| 33 |
for task in tasks:
|
| 34 |
task.start()
|
| 35 |
# bet_users.start()
|
| 36 |
for task in tasks:
|
| 37 |
task.join()
|
| 38 |
# bet_users.join()
|
| 39 |
+
|
requirements.txt
CHANGED
|
@@ -6,4 +6,5 @@ pillow
|
|
| 6 |
python-dotenv
|
| 7 |
markdownify
|
| 8 |
aiosqlite
|
| 9 |
-
ImageHash
|
|
|
|
|
|
| 6 |
python-dotenv
|
| 7 |
markdownify
|
| 8 |
aiosqlite
|
| 9 |
+
ImageHash
|
| 10 |
+
gradio
|