Futuresony commited on
Commit
2b646e4
·
verified ·
1 Parent(s): d2bf3b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 with no timeout
9
- client = InferenceClient("Futuresony/future_ai_12_10_2024.gguf", timeout=None)
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": f"An error occurred: {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
- app.run(host="0.0.0.0", port=port)
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)