Spaces:
Runtime error
Runtime error
Update run.py
Browse files
run.py
CHANGED
@@ -40,11 +40,6 @@ def ensure_directories():
|
|
40 |
os.makedirs(logs_dir, exist_ok=True)
|
41 |
|
42 |
|
43 |
-
def is_huggingface_space():
|
44 |
-
"""Check if the app is running on Hugging Face Spaces"""
|
45 |
-
return "SPACE_ID" in os.environ
|
46 |
-
|
47 |
-
|
48 |
def main():
|
49 |
"""Main function to run the application"""
|
50 |
print("Visual Question Answering - Multi-Modal AI Application with Streamlit")
|
@@ -74,33 +69,21 @@ def main():
|
|
74 |
print("Press Ctrl+C to exit")
|
75 |
|
76 |
# Run the Streamlit app
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
app_path,
|
93 |
-
"--server.port",
|
94 |
-
str(port),
|
95 |
-
"--server.address",
|
96 |
-
"0.0.0.0",
|
97 |
-
]
|
98 |
-
try:
|
99 |
-
subprocess.run(cmd)
|
100 |
-
except KeyboardInterrupt:
|
101 |
-
print("\nShutting down the application...")
|
102 |
-
except Exception as e:
|
103 |
-
print(f"Error launching Streamlit: {e}")
|
104 |
|
105 |
|
106 |
if __name__ == "__main__":
|
|
|
40 |
os.makedirs(logs_dir, exist_ok=True)
|
41 |
|
42 |
|
|
|
|
|
|
|
|
|
|
|
43 |
def main():
|
44 |
"""Main function to run the application"""
|
45 |
print("Visual Question Answering - Multi-Modal AI Application with Streamlit")
|
|
|
69 |
print("Press Ctrl+C to exit")
|
70 |
|
71 |
# Run the Streamlit app
|
72 |
+
cmd = [
|
73 |
+
"streamlit",
|
74 |
+
"run",
|
75 |
+
app_path,
|
76 |
+
"--server.port",
|
77 |
+
str(port),
|
78 |
+
"--server.address",
|
79 |
+
"0.0.0.0",
|
80 |
+
]
|
81 |
+
try:
|
82 |
+
subprocess.run(cmd)
|
83 |
+
except KeyboardInterrupt:
|
84 |
+
print("\nShutting down the application...")
|
85 |
+
except Exception as e:
|
86 |
+
print(f"Error launching Streamlit: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
|
89 |
if __name__ == "__main__":
|