Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import google.generativeai as genai
|
|
5 |
import gradio as gr
|
6 |
|
7 |
# Get the Google API key from environment variables
|
8 |
-
|
9 |
|
10 |
# Define the title and subtitle for the Gradio interface
|
11 |
TITLE = """<h1 align="center">ποΈ AI Personal Trainer Playground πͺ</h1>"""
|
@@ -44,13 +44,7 @@ def bot(
|
|
44 |
text_prompt_component: str,
|
45 |
chatbot: List[Tuple[str, str]]
|
46 |
):
|
47 |
-
|
48 |
-
google_key = GOOGLE_API_KEY
|
49 |
-
if not google_key:
|
50 |
-
raise ValueError(
|
51 |
-
"GOOGLE_API_KEY is not set. "
|
52 |
-
"Please follow the instructions in the README to set it up.")
|
53 |
-
|
54 |
# Combine the user input with the predefined prompt
|
55 |
user_input = chatbot[-1][0]
|
56 |
combined_prompt = Prompt + "\n" + user_input
|
@@ -102,7 +96,7 @@ def bot(
|
|
102 |
time.sleep(0.01)
|
103 |
yield chatbot
|
104 |
|
105 |
-
|
106 |
video_prompt_component = gr.Video(label="Video", autoplay=True)
|
107 |
|
108 |
model_selection = gr.Dropdown(["gemini-1.5-flash-latest", "gemini-1.5-pro-latest"], label="Select Gemini Model", value="gemini-1.5-pro-latest")
|
|
|
5 |
import gradio as gr
|
6 |
|
7 |
# Get the Google API key from environment variables
|
8 |
+
google_key = os.environ.get("GOOGLE_API_KEY")
|
9 |
|
10 |
# Define the title and subtitle for the Gradio interface
|
11 |
TITLE = """<h1 align="center">ποΈ AI Personal Trainer Playground πͺ</h1>"""
|
|
|
44 |
text_prompt_component: str,
|
45 |
chatbot: List[Tuple[str, str]]
|
46 |
):
|
47 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
# Combine the user input with the predefined prompt
|
49 |
user_input = chatbot[-1][0]
|
50 |
combined_prompt = Prompt + "\n" + user_input
|
|
|
96 |
time.sleep(0.01)
|
97 |
yield chatbot
|
98 |
|
99 |
+
|
100 |
video_prompt_component = gr.Video(label="Video", autoplay=True)
|
101 |
|
102 |
model_selection = gr.Dropdown(["gemini-1.5-flash-latest", "gemini-1.5-pro-latest"], label="Select Gemini Model", value="gemini-1.5-pro-latest")
|