xcx0902 commited on
Commit
46bd13a
·
verified ·
1 Parent(s): 3ed8626

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. Dockerfile +2 -1
  2. app.py +1 -4
  3. keepalive.py +3 -8
Dockerfile CHANGED
@@ -10,4 +10,5 @@ COPY --chown=user ./requirements.txt requirements.txt
10
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
 
12
  COPY --chown=user . /app
13
- CMD ["python", "app.py", "1>&2"]
 
 
10
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
 
12
  COPY --chown=user . /app
13
+ CMD ["python", "app.py", "1>&2"]
14
+ CMD ["uvicorn", "app:keepalive", "--host", "0.0.0.0", "--port", "7860"]
app.py CHANGED
@@ -5,7 +5,6 @@ import requests
5
  import time
6
  import openai
7
  import random
8
- import keepalive
9
 
10
  intents = discord.Intents.default()
11
  intents.message_content = True
@@ -133,6 +132,4 @@ async def on_message(message):
133
  raise
134
 
135
  # print(os.getenv("TOKEN"))
136
- client.run(os.getenv('TOKEN'))
137
-
138
- keepalive.keepalive()
 
5
  import time
6
  import openai
7
  import random
 
8
 
9
  intents = discord.Intents.default()
10
  intents.message_content = True
 
132
  raise
133
 
134
  # print(os.getenv("TOKEN"))
135
+ client.run(os.getenv('TOKEN'))
 
 
keepalive.py CHANGED
@@ -1,12 +1,7 @@
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")
 
1
  from fastapi import FastAPI
 
2
 
3
+ keepalive = FastAPI()
4
 
5
+ @keepalive.get("/")
 
6
  def root():
7
+ return {"Hello": "World"}