Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,6 @@ app = Flask(__name__)
|
|
15 |
|
16 |
@app.route('/mistral7b', methods=['POST'])
|
17 |
def generate():
|
18 |
-
global counter
|
19 |
# Get data from the request
|
20 |
data = request.json
|
21 |
prompt = data.get('prompt', '')
|
@@ -35,7 +34,6 @@ def generate():
|
|
35 |
|
36 |
@app.route('/chatgpt', methods=['POST'])
|
37 |
def chat():
|
38 |
-
global counter
|
39 |
# Get data from the request
|
40 |
data = request.json
|
41 |
user_message = data.get('message', '')
|
@@ -54,7 +52,6 @@ def chat():
|
|
54 |
|
55 |
@app.route('/news', methods=['GET'])
|
56 |
def get_news():
|
57 |
-
global counter
|
58 |
# Get data from the request
|
59 |
key = request.args.get('key', '')
|
60 |
cache_flag = request.args.get('cache', 'True').lower() == 'true'
|
@@ -78,10 +75,12 @@ def Web():
|
|
78 |
}
|
79 |
return jsonify(result)
|
80 |
|
81 |
-
@app.route('/imageneration', methods=['
|
82 |
def IMGEN():
|
83 |
-
|
84 |
-
|
|
|
|
|
85 |
|
86 |
API_URL = "https://api-inference.huggingface.co/models/OEvortex/HelpingAI-PixelCraft"
|
87 |
headers = {"Authorization": f"Bearer {key}"}
|
@@ -95,7 +94,6 @@ def IMGEN():
|
|
95 |
|
96 |
@app.route('/divyanshpizza', methods=['GET'])
|
97 |
def get_counters():
|
98 |
-
global counter
|
99 |
return jsonify(counter),jsonify({"data":str(listdir(r"static/data/"))})
|
100 |
|
101 |
|
|
|
15 |
|
16 |
@app.route('/mistral7b', methods=['POST'])
|
17 |
def generate():
|
|
|
18 |
# Get data from the request
|
19 |
data = request.json
|
20 |
prompt = data.get('prompt', '')
|
|
|
34 |
|
35 |
@app.route('/chatgpt', methods=['POST'])
|
36 |
def chat():
|
|
|
37 |
# Get data from the request
|
38 |
data = request.json
|
39 |
user_message = data.get('message', '')
|
|
|
52 |
|
53 |
@app.route('/news', methods=['GET'])
|
54 |
def get_news():
|
|
|
55 |
# Get data from the request
|
56 |
key = request.args.get('key', '')
|
57 |
cache_flag = request.args.get('cache', 'True').lower() == 'true'
|
|
|
75 |
}
|
76 |
return jsonify(result)
|
77 |
|
78 |
+
@app.route('/imageneration', methods=['POST'])
|
79 |
def IMGEN():
|
80 |
+
data = request.json
|
81 |
+
prompt = data.get('prompt', '')
|
82 |
+
key = data.get('key', '')
|
83 |
+
|
84 |
|
85 |
API_URL = "https://api-inference.huggingface.co/models/OEvortex/HelpingAI-PixelCraft"
|
86 |
headers = {"Authorization": f"Bearer {key}"}
|
|
|
94 |
|
95 |
@app.route('/divyanshpizza', methods=['GET'])
|
96 |
def get_counters():
|
|
|
97 |
return jsonify(counter),jsonify({"data":str(listdir(r"static/data/"))})
|
98 |
|
99 |
|