Docfile commited on
Commit
7fe77ba
·
verified ·
1 Parent(s): 0f57b67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -5,7 +5,7 @@ import google.generativeai as genai
5
  api_key = "AIzaSyDsrgHAnNWDJqWWzq3oFAbUy5W40cUT0dY"
6
  genai.configure(api_key=api_key)
7
 
8
- def describe_video(video_file):
9
  try:
10
 
11
  print(f"Uploading file...")
@@ -23,7 +23,7 @@ def describe_video(video_file):
23
  raise ValueError(uploaded_video.state.name)
24
  print(f"Video processing complete: " + uploaded_video.uri)
25
 
26
- prompt = "Describe this video."
27
 
28
  # Set the model to Gemini 1.5 Pro.
29
  model = genai.GenerativeModel(model_name="models/gemini-1.5-flash-latest")
@@ -46,10 +46,10 @@ def describe_video(video_file):
46
  # Create the Gradio interface
47
  iface = gr.Interface(
48
  fn=describe_video,
49
- inputs=gr.Video(),
50
  outputs=gr.Textbox(),
51
- title="Video Description with Gemini",
52
- description="Upload a video to get a description using Google Gemini",
53
  )
54
 
55
  # Launch the interface
 
5
  api_key = "AIzaSyDsrgHAnNWDJqWWzq3oFAbUy5W40cUT0dY"
6
  genai.configure(api_key=api_key)
7
 
8
+ def describe_video(pp,video_file):
9
  try:
10
 
11
  print(f"Uploading file...")
 
23
  raise ValueError(uploaded_video.state.name)
24
  print(f"Video processing complete: " + uploaded_video.uri)
25
 
26
+ prompt = pp
27
 
28
  # Set the model to Gemini 1.5 Pro.
29
  model = genai.GenerativeModel(model_name="models/gemini-1.5-flash-latest")
 
46
  # Create the Gradio interface
47
  iface = gr.Interface(
48
  fn=describe_video,
49
+ inputs=[gr.Textbox(),gr.Video()],
50
  outputs=gr.Textbox(),
51
+ title="y Video.",
52
+ description="Pose des questions sur la vidéo et obtient une réponse.",
53
  )
54
 
55
  # Launch the interface