mozzicato commited on
Commit
8eb8af1
·
verified ·
1 Parent(s): dd2473f
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1525,10 +1525,13 @@ rag = WemaRAGSystem()
1525
  rag.load() # Load your existing index
1526
 
1527
  # Cell 3: Initialize API keys
1528
- from google.colab import userdata
1529
 
1530
- GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')
1531
- SPITCH_API_KEY = userdata.get('SPITCH_API_KEY') # Add this to your Colab secrets
 
 
 
1532
 
1533
  # Cell 4: Launch voice interface
1534
  # The create_voice_gradio_interface function needs the chain, not the google_api_key directly.
 
1525
  rag.load() # Load your existing index
1526
 
1527
  # Cell 3: Initialize API keys
1528
+ import os
1529
 
1530
+ GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
1531
+ SPITCH_API_KEY = os.getenv("SPITCH_API_KEY")
1532
+
1533
+ if not GOOGLE_API_KEY or not SPITCH_API_KEY:
1534
+ raise ValueError("Missing one or more API keys. Make sure they are added as secrets in your Space.")
1535
 
1536
  # Cell 4: Launch voice interface
1537
  # The create_voice_gradio_interface function needs the chain, not the google_api_key directly.