Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- app.py +4 -1
- keepalive.py +12 -0
- requirements.txt +3 -1
app.py
CHANGED
@@ -5,6 +5,7 @@ import requests
|
|
5 |
import time
|
6 |
import openai
|
7 |
import random
|
|
|
8 |
|
9 |
intents = discord.Intents.default()
|
10 |
intents.message_content = True
|
@@ -132,4 +133,6 @@ async def on_message(message):
|
|
132 |
raise
|
133 |
|
134 |
# print(os.getenv("TOKEN"))
|
135 |
-
client.run(os.getenv('TOKEN'))
|
|
|
|
|
|
5 |
import time
|
6 |
import openai
|
7 |
import random
|
8 |
+
import keepalive
|
9 |
|
10 |
intents = discord.Intents.default()
|
11 |
intents.message_content = True
|
|
|
133 |
raise
|
134 |
|
135 |
# print(os.getenv("TOKEN"))
|
136 |
+
client.run(os.getenv('TOKEN'))
|
137 |
+
|
138 |
+
keepalive.keepalive()
|
keepalive.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
import uvicorn
|
3 |
+
|
4 |
+
app = FastAPI()
|
5 |
+
|
6 |
+
|
7 |
+
@app.get("/")
|
8 |
+
def root():
|
9 |
+
return {"Hello": "World"}
|
10 |
+
|
11 |
+
def keepalive():
|
12 |
+
uvicorn.run(app=app, host="0.0.0.0", port="7860")
|
requirements.txt
CHANGED
@@ -1,3 +1,5 @@
|
|
1 |
discord
|
2 |
requests
|
3 |
-
openai
|
|
|
|
|
|
1 |
discord
|
2 |
requests
|
3 |
+
openai
|
4 |
+
fastapi
|
5 |
+
uvicorn
|