Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,8 @@ from pathlib import Path
|
|
| 10 |
def get_api_key():
|
| 11 |
GOOGLE_API_KEY = os.environ.get("GOOGLE_API_KEY", "")
|
| 12 |
if not GOOGLE_API_KEY:
|
| 13 |
-
|
|
|
|
| 14 |
return GOOGLE_API_KEY or "AIzaSyDCMPwXHagWqYTQB3HL7FceHEmKUv3v4wc"
|
| 15 |
|
| 16 |
# VideoProcessor class
|
|
@@ -45,11 +46,12 @@ def main():
|
|
| 45 |
st.header("Retrieval-Augmented Generation - Gemini 2.0")
|
| 46 |
st.markdown("---")
|
| 47 |
|
|
|
|
|
|
|
| 48 |
api_key = get_api_key()
|
| 49 |
|
| 50 |
if not api_key:
|
| 51 |
-
st.
|
| 52 |
-
#st.sidebar.error("Please enter your API key to proceed.")
|
| 53 |
st.stop()
|
| 54 |
|
| 55 |
# Step 2: Upload Video
|
|
@@ -112,4 +114,4 @@ def main():
|
|
| 112 |
st.info("👈 Please upload a video to start chatting.")
|
| 113 |
|
| 114 |
if __name__ == "__main__":
|
| 115 |
-
main()
|
|
|
|
| 10 |
def get_api_key():
|
| 11 |
GOOGLE_API_KEY = os.environ.get("GOOGLE_API_KEY", "")
|
| 12 |
if not GOOGLE_API_KEY:
|
| 13 |
+
st.subheader("Step 1: Enter your Gemini 2.0 flash API key")
|
| 14 |
+
GOOGLE_API_KEY = st.text_input("Enter your Gemini API key", type="password")
|
| 15 |
return GOOGLE_API_KEY or "AIzaSyDCMPwXHagWqYTQB3HL7FceHEmKUv3v4wc"
|
| 16 |
|
| 17 |
# VideoProcessor class
|
|
|
|
| 46 |
st.header("Retrieval-Augmented Generation - Gemini 2.0")
|
| 47 |
st.markdown("---")
|
| 48 |
|
| 49 |
+
# Step 1: API Key input
|
| 50 |
+
st.subheader("Step 1: Enter your Gemini API key")
|
| 51 |
api_key = get_api_key()
|
| 52 |
|
| 53 |
if not api_key:
|
| 54 |
+
st.error("Please enter your API key to proceed.")
|
|
|
|
| 55 |
st.stop()
|
| 56 |
|
| 57 |
# Step 2: Upload Video
|
|
|
|
| 114 |
st.info("👈 Please upload a video to start chatting.")
|
| 115 |
|
| 116 |
if __name__ == "__main__":
|
| 117 |
+
main()
|