Update app.py
Browse files
app.py
CHANGED
@@ -7,8 +7,8 @@ from PIL import Image
|
|
7 |
import gradio as gr # Import Gradio
|
8 |
|
9 |
# Initialize the Flask app
|
10 |
-
|
11 |
-
CORS(
|
12 |
|
13 |
# Initialize the InferenceClient with your Hugging Face token
|
14 |
HF_TOKEN = os.environ.get("HF_TOKEN") # Ensure to set your Hugging Face token in the environment
|
@@ -51,4 +51,4 @@ gr.Interface(
|
|
51 |
|
52 |
# Add this block to make sure your app runs when called
|
53 |
if __name__ == "__main__":
|
54 |
-
|
|
|
7 |
import gradio as gr # Import Gradio
|
8 |
|
9 |
# Initialize the Flask app
|
10 |
+
app = Flask(__name__)
|
11 |
+
CORS(app) # Enable CORS for all routes
|
12 |
|
13 |
# Initialize the InferenceClient with your Hugging Face token
|
14 |
HF_TOKEN = os.environ.get("HF_TOKEN") # Ensure to set your Hugging Face token in the environment
|
|
|
51 |
|
52 |
# Add this block to make sure your app runs when called
|
53 |
if __name__ == "__main__":
|
54 |
+
app.run(host='0.0.0.0', port=7860) # Run directly if needed for testing
|