Spaces:
Running
Running
Anirudh Esthuri
commited on
Commit
·
02cf54d
1
Parent(s):
98b6550
Fix: Add port configuration to app.py and fix config.toml formatting
Browse files- .streamlit/config.toml +6 -6
- app.py +4 -0
.streamlit/config.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
| 1 |
+
[server]
|
| 2 |
+
port = 7860
|
| 3 |
+
address = "0.0.0.0"
|
| 4 |
+
headless = true
|
| 5 |
+
enableCORS = false
|
| 6 |
+
enableXsrfProtection = false
|
app.py
CHANGED
|
@@ -6,6 +6,10 @@ from gateway_client import delete_profile, ingest_and_rewrite
|
|
| 6 |
from llm import chat, set_model
|
| 7 |
from model_config import MODEL_CHOICES, MODEL_TO_PROVIDER
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
def rewrite_message(
|
| 11 |
msg: str, persona_name: str, show_rationale: bool, skip_rewrite: bool
|
|
|
|
| 6 |
from llm import chat, set_model
|
| 7 |
from model_config import MODEL_CHOICES, MODEL_TO_PROVIDER
|
| 8 |
|
| 9 |
+
# Configure Streamlit for Hugging Face Spaces (port 7860)
|
| 10 |
+
os.environ["STREAMLIT_SERVER_PORT"] = "7860"
|
| 11 |
+
os.environ["STREAMLIT_SERVER_ADDRESS"] = "0.0.0.0"
|
| 12 |
+
|
| 13 |
|
| 14 |
def rewrite_message(
|
| 15 |
msg: str, persona_name: str, show_rationale: bool, skip_rewrite: bool
|