Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
|
11 |
-
#
|
12 |
-
#
|
13 |
-
|
14 |
|
15 |
-
|
16 |
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
|
22 |
|
23 |
# @app.route("/infer_biggan")
|
@@ -56,23 +56,23 @@
|
|
56 |
# return jsonify({"output": output})
|
57 |
|
58 |
|
59 |
-
|
60 |
-
|
61 |
|
62 |
-
from flask import Flask, redirect, url_for, session, request, jsonify, render_template
|
63 |
-
from google.oauth2 import id_token
|
64 |
-
from google.auth.transport import requests as grequests
|
65 |
-
import os
|
66 |
|
67 |
-
app = Flask(__name__)
|
68 |
-
app.secret_key = os.urandom(24)
|
69 |
|
70 |
-
CLIENT_ID = "your_google_client_id"
|
71 |
-
CLIENT_SECRET = os.environ.get("GOOGLE_CLIENT_SECRET")
|
72 |
|
73 |
-
@app.route("/")
|
74 |
-
def index():
|
75 |
-
|
76 |
|
77 |
# @app.route("/login")
|
78 |
# def login():
|
@@ -111,6 +111,6 @@ def index():
|
|
111 |
# session.pop('user', None)
|
112 |
# return redirect(url_for("index"))
|
113 |
|
114 |
-
if __name__ == "__main__":
|
115 |
-
|
116 |
|
|
|
1 |
+
import os
|
2 |
+
import requests
|
3 |
+
import json
|
4 |
+
from io import BytesIO
|
5 |
|
6 |
+
from flask import Flask, jsonify, render_template, request, send_file
|
7 |
|
8 |
+
from modules.inference import infer_t5
|
9 |
+
from modules.dataset import query_emotion
|
10 |
|
11 |
+
# https://huggingface.co/settings/tokens
|
12 |
+
# https://huggingface.co/spaces/{username}/{space}/settings
|
13 |
+
API_TOKEN = os.getenv("BIG_GAN_TOKEN")
|
14 |
|
15 |
+
app = Flask(__name__)
|
16 |
|
17 |
|
18 |
+
@app.route("/")
|
19 |
+
def index():
|
20 |
+
return render_template("index.html")
|
21 |
|
22 |
|
23 |
# @app.route("/infer_biggan")
|
|
|
56 |
# return jsonify({"output": output})
|
57 |
|
58 |
|
59 |
+
if __name__ == "__main__":
|
60 |
+
app.run(host="0.0.0.0", port=7860)
|
61 |
|
62 |
+
# from flask import Flask, redirect, url_for, session, request, jsonify, render_template
|
63 |
+
# from google.oauth2 import id_token
|
64 |
+
# from google.auth.transport import requests as grequests
|
65 |
+
# import os
|
66 |
|
67 |
+
# app = Flask(__name__)
|
68 |
+
# app.secret_key = os.urandom(24)
|
69 |
|
70 |
+
# CLIENT_ID = "your_google_client_id"
|
71 |
+
# CLIENT_SECRET = os.environ.get("GOOGLE_CLIENT_SECRET")
|
72 |
|
73 |
+
# @app.route("/")
|
74 |
+
# def index():
|
75 |
+
# return render_template("index.html")
|
76 |
|
77 |
# @app.route("/login")
|
78 |
# def login():
|
|
|
111 |
# session.pop('user', None)
|
112 |
# return redirect(url_for("index"))
|
113 |
|
114 |
+
# if __name__ == "__main__":
|
115 |
+
# app.run(debug=True)
|
116 |
|