Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ import os
|
|
5 |
# Initialize the Flask app
|
6 |
app = Flask(__name__)
|
7 |
|
8 |
-
# Initialize the Hugging Face Inference Client
|
9 |
-
client = InferenceClient("Futuresony/future_ai_12_10_2024.gguf"
|
10 |
|
11 |
@app.route("/")
|
12 |
def home():
|
@@ -25,10 +25,10 @@ def fetch_message():
|
|
25 |
response = client.text_generation(message)
|
26 |
return jsonify({"response": response})
|
27 |
except Exception as e:
|
28 |
-
return jsonify({"error":
|
29 |
|
30 |
if __name__ == "__main__":
|
31 |
# Use PORT environment variable or default to 7860
|
32 |
port = int(os.getenv("PORT", 7860))
|
33 |
-
|
34 |
-
|
|
|
5 |
# Initialize the Flask app
|
6 |
app = Flask(__name__)
|
7 |
|
8 |
+
# Initialize the Hugging Face Inference Client
|
9 |
+
client = InferenceClient("Futuresony/future_ai_12_10_2024.gguf")
|
10 |
|
11 |
@app.route("/")
|
12 |
def home():
|
|
|
25 |
response = client.text_generation(message)
|
26 |
return jsonify({"response": response})
|
27 |
except Exception as e:
|
28 |
+
return jsonify({"error": str(e)}), 500
|
29 |
|
30 |
if __name__ == "__main__":
|
31 |
# Use PORT environment variable or default to 7860
|
32 |
port = int(os.getenv("PORT", 7860))
|
33 |
+
ap
|
34 |
+
p.run(host="0.0.0.0", port=port)
|