ProvLeon commited on
Commit
e960318
·
verified ·
1 Parent(s): 63b2f7a

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -2,6 +2,8 @@ import os
2
  import sys
3
  from pathlib import Path
4
 
 
 
5
  # Check PyTorch availability first
6
  try:
7
  import torch
@@ -30,7 +32,6 @@ current_dir = Path(__file__).parent
30
  sys.path.insert(0, str(current_dir / "src"))
31
  sys.path.insert(0, str(current_dir))
32
 
33
- from src.speech_recognizer import create_speech_recognizer
34
 
35
  # --- Configuration ---
36
  # It's recommended to use a specific model from the Hub.
@@ -233,7 +234,7 @@ if __name__ == "__main__":
233
  space_id = os.getenv("SPACE_ID", "unknown")
234
 
235
  # Debug environment info
236
- print(f"🔍 Environment Detection:")
237
  print(f" - SPACE_ID: {space_id}")
238
  print(f" - Is HF Space: {is_hf_space}")
239
  print(f" - Model Repo: {HUGGINGFACE_REPO}")
@@ -244,7 +245,7 @@ if __name__ == "__main__":
244
  iface.launch(
245
  server_name="0.0.0.0",
246
  server_port=7860,
247
- share=False, # Not needed on HF Spaces - already public
248
  )
249
  else:
250
  print("💻 Running locally - creating public share link for development")
 
2
  import sys
3
  from pathlib import Path
4
 
5
+ from src.speech_recognizer import create_speech_recognizer
6
+
7
  # Check PyTorch availability first
8
  try:
9
  import torch
 
32
  sys.path.insert(0, str(current_dir / "src"))
33
  sys.path.insert(0, str(current_dir))
34
 
 
35
 
36
  # --- Configuration ---
37
  # It's recommended to use a specific model from the Hub.
 
234
  space_id = os.getenv("SPACE_ID", "unknown")
235
 
236
  # Debug environment info
237
+ print("🔍 Environment Detection:")
238
  print(f" - SPACE_ID: {space_id}")
239
  print(f" - Is HF Space: {is_hf_space}")
240
  print(f" - Model Repo: {HUGGINGFACE_REPO}")
 
245
  iface.launch(
246
  server_name="0.0.0.0",
247
  server_port=7860,
248
+ share=True, # Not needed on HF Spaces - already public
249
  )
250
  else:
251
  print("💻 Running locally - creating public share link for development")