Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -88,13 +88,13 @@ if uploaded_file:
|
|
88 |
st.write("📖 Summarizing captions using AI...")
|
89 |
|
90 |
def summarize_captions(captions):
|
91 |
-
prompt = f"Summarize the following sequence of video frames into a meaningful story under
|
92 |
|
93 |
completion = client.chat.completions.create(
|
94 |
model="gpt-4o-mini",
|
95 |
messages=[{"role": "system", "content": "You are an AI that summarizes video content."},
|
96 |
{"role": "user", "content": prompt}],
|
97 |
-
max_tokens=
|
98 |
)
|
99 |
return completion.choices[0].message.content
|
100 |
|
|
|
88 |
st.write("📖 Summarizing captions using AI...")
|
89 |
|
90 |
def summarize_captions(captions):
|
91 |
+
prompt = f"Summarize the following sequence of video frames into a meaningful story under 800 characters:\n\n{captions}"
|
92 |
|
93 |
completion = client.chat.completions.create(
|
94 |
model="gpt-4o-mini",
|
95 |
messages=[{"role": "system", "content": "You are an AI that summarizes video content."},
|
96 |
{"role": "user", "content": prompt}],
|
97 |
+
max_tokens=200
|
98 |
)
|
99 |
return completion.choices[0].message.content
|
100 |
|