Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -7,10 +7,11 @@ import os
|
|
7 |
app = Flask(__name__)
|
8 |
|
9 |
# Get Hugging Face credentials from environment variables
|
10 |
-
|
11 |
-
|
12 |
-
email
|
13 |
-
|
|
|
14 |
|
15 |
@app.route("/")
|
16 |
def hello():
|
@@ -25,7 +26,13 @@ def chat():
|
|
25 |
email = data.get('email')
|
26 |
password = data.get('password')
|
27 |
|
28 |
-
if not (
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
return jsonify({"error": "Missing prompt, email, or password"}), 400
|
30 |
|
31 |
# Generate the response
|
|
|
7 |
app = Flask(__name__)
|
8 |
|
9 |
# Get Hugging Face credentials from environment variables
|
10 |
+
email = os.getenv('HF_EMAIL')
|
11 |
+
password = os.getenv('HF_PASS')
|
12 |
+
print(f"email is {email} and password is {password}")
|
13 |
+
#email = "trianatha3@gmail.com"
|
14 |
+
#password = "@Tri@n@th@1"
|
15 |
|
16 |
@app.route("/")
|
17 |
def hello():
|
|
|
26 |
email = data.get('email')
|
27 |
password = data.get('password')
|
28 |
|
29 |
+
if not (password):
|
30 |
+
return jsonify({"error": "Missing password"}), 400
|
31 |
+
elif not (prompt):
|
32 |
+
return jsonify({"error": "Missing prompt"}), 400
|
33 |
+
elif not (email):
|
34 |
+
return jsonify({"error": "Missing email"}), 400
|
35 |
+
else:
|
36 |
return jsonify({"error": "Missing prompt, email, or password"}), 400
|
37 |
|
38 |
# Generate the response
|