Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,23 @@ import logging
|
|
5 |
import requests
|
6 |
from huggingface_hub import login, whoami
|
7 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
webhook_server = os.getenv('webhook_server')
|
10 |
API_TOKEN = os.getenv('ZeroGPU')
|
|
|
5 |
import requests
|
6 |
from huggingface_hub import login, whoami
|
7 |
import torch
|
8 |
+
from flask import Flask, send_from_directory
|
9 |
+
|
10 |
+
|
11 |
+
# Define your Flask server
|
12 |
+
app = Flask(__name__)
|
13 |
+
|
14 |
+
@app.route('/privacy_policy.html')
|
15 |
+
def privacy_policy():
|
16 |
+
return send_from_directory('.', 'privacy_policy.html')
|
17 |
+
|
18 |
+
# Start Flask server in a separate thread
|
19 |
+
def run_flask():
|
20 |
+
app.run(port=8000) # Change the port if necessary
|
21 |
+
|
22 |
+
# Start Flask server thread
|
23 |
+
Thread(target=run_flask, daemon=True).start()
|
24 |
+
|
25 |
|
26 |
webhook_server = os.getenv('webhook_server')
|
27 |
API_TOKEN = os.getenv('ZeroGPU')
|