Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -24,11 +24,14 @@ st.markdown(
|
|
24 |
.stApp {
|
25 |
background-image: url("https://s29938.pcdn.co/wp-content/uploads/2019/02/Wallpaper-Kemra-WhiteSubwayTile-4-1100x1320.jpg.optimal.jpg");
|
26 |
background-size: cover;
|
|
|
|
|
27 |
}
|
28 |
</style>
|
29 |
""",
|
30 |
unsafe_allow_html=True
|
31 |
)
|
|
|
32 |
|
33 |
uploaded_file = st.file_uploader("π€ Upload a Video File", type=["mp4"])
|
34 |
|
@@ -85,12 +88,13 @@ if uploaded_file:
|
|
85 |
st.write("π Summarizing captions using AI...")
|
86 |
|
87 |
def summarize_captions(captions):
|
88 |
-
prompt = f"Summarize the following sequence of video frames into a meaningful story:\n\n{captions}"
|
89 |
|
90 |
completion = client.chat.completions.create(
|
91 |
model="gpt-4o-mini",
|
92 |
messages=[{"role": "system", "content": "You are an AI that summarizes video content."},
|
93 |
-
{"role": "user", "content": prompt}]
|
|
|
94 |
)
|
95 |
return completion.choices[0].message.content
|
96 |
|
|
|
24 |
.stApp {
|
25 |
background-image: url("https://s29938.pcdn.co/wp-content/uploads/2019/02/Wallpaper-Kemra-WhiteSubwayTile-4-1100x1320.jpg.optimal.jpg");
|
26 |
background-size: cover;
|
27 |
+
background-position: center;
|
28 |
+
background-repeat: no-repeat;
|
29 |
}
|
30 |
</style>
|
31 |
""",
|
32 |
unsafe_allow_html=True
|
33 |
)
|
34 |
+
|
35 |
|
36 |
uploaded_file = st.file_uploader("π€ Upload a Video File", type=["mp4"])
|
37 |
|
|
|
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 500 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=150
|
98 |
)
|
99 |
return completion.choices[0].message.content
|
100 |
|