rongo1
commited on
Commit
·
3b89417
1
Parent(s):
1e9afab
feat: trying to fix localhost issue
Browse files- app.py +11 -2
- env.example +1 -1
- setup_hf_space.md +2 -2
app.py
CHANGED
@@ -768,8 +768,17 @@ hf_space_password = os.getenv("SPACE_PASSWORD")
|
|
768 |
if hf_space_password:
|
769 |
# Launch with password protection
|
770 |
logger.info("Launching with password protection enabled")
|
771 |
-
demo.launch(
|
|
|
|
|
|
|
|
|
|
|
772 |
else:
|
773 |
# Launch without password protection
|
774 |
logger.warning("SPACE_PASSWORD not set - launching without password protection")
|
775 |
-
demo.launch(
|
|
|
|
|
|
|
|
|
|
768 |
if hf_space_password:
|
769 |
# Launch with password protection
|
770 |
logger.info("Launching with password protection enabled")
|
771 |
+
demo.launch(
|
772 |
+
auth=("user", hf_space_password),
|
773 |
+
server_name="0.0.0.0",
|
774 |
+
server_port=7860,
|
775 |
+
ssr_mode=False # Disable SSR to avoid svelte-i18n errors
|
776 |
+
)
|
777 |
else:
|
778 |
# Launch without password protection
|
779 |
logger.warning("SPACE_PASSWORD not set - launching without password protection")
|
780 |
+
demo.launch(
|
781 |
+
server_name="0.0.0.0",
|
782 |
+
server_port=7860,
|
783 |
+
ssr_mode=False # Disable SSR to avoid svelte-i18n errors
|
784 |
+
)
|
env.example
CHANGED
@@ -25,7 +25,7 @@ GOOGLE_TOKEN_BASE64=your_base64_encoded_token_here
|
|
25 |
# Set this to enable password protection when making your Space public
|
26 |
# Users will need to login with username: "user" and this password
|
27 |
# For deployment: Add this as a secret in your Space settings
|
28 |
-
|
29 |
|
30 |
# Examples:
|
31 |
# Gemini_API=AIzaSyBxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
25 |
# Set this to enable password protection when making your Space public
|
26 |
# Users will need to login with username: "user" and this password
|
27 |
# For deployment: Add this as a secret in your Space settings
|
28 |
+
SPACE_PASSWORD=your_space_password_here
|
29 |
|
30 |
# Examples:
|
31 |
# Gemini_API=AIzaSyBxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
setup_hf_space.md
CHANGED
@@ -35,7 +35,7 @@ business_cards/.gitkeep
|
|
35 |
- **Value**: Your AI API key
|
36 |
|
37 |
**Optional (for password protection):**
|
38 |
-
- **Name**: `
|
39 |
- **Value**: Your desired password
|
40 |
- **Note**: Users will login with username: `user` and this password
|
41 |
|
@@ -59,7 +59,7 @@ business_cards/.gitkeep
|
|
59 |
|
60 |
## Environment Variables Required
|
61 |
- `Gemini_API`: Your AI API key (required)
|
62 |
-
- `
|
63 |
|
64 |
## Notes
|
65 |
- The space will create necessary directories automatically
|
|
|
35 |
- **Value**: Your AI API key
|
36 |
|
37 |
**Optional (for password protection):**
|
38 |
+
- **Name**: `SPACE_PASSWORD`
|
39 |
- **Value**: Your desired password
|
40 |
- **Note**: Users will login with username: `user` and this password
|
41 |
|
|
|
59 |
|
60 |
## Environment Variables Required
|
61 |
- `Gemini_API`: Your AI API key (required)
|
62 |
+
- `SPACE_PASSWORD`: Password for space access (optional)
|
63 |
|
64 |
## Notes
|
65 |
- The space will create necessary directories automatically
|