MediaSearch / app.py
azamat's picture
Videos in a row
ffdb835
raw
history blame
2.94 kB
import os
import gdown
import gradio as gr
from weaviate_explorer import WeaviateExplorer
weaviate_explorer = WeaviateExplorer()
examples = [
"How can I validate my idea with potential customers?",
"How much funding will I need to get started?",
"What are the potential revenue streams and business models?",
"How should I structure my team and distribute equity?",
"What are the must-have features for my minimum viable product (MVP)?",
"Should I outsource any development work or hire in-house talent?",
"What metrics should I track to measure success and growth?",
"What are the key elements of a compelling pitch deck and investor presentation?",
"How can I negotiate fair and favorable terms with investors?",
"How can I generate early traction and attract my first customers?",
"What marketing and advertising channels should I prioritize?",
"How can I gather and incorporate customer feedback for product improvement?",
"What are the key areas I need to focus on for scaling (product development, hiring, operations, etc.)?",
"What are the different types of funding rounds (Seed, Series A, B, C, etc.), and when should I pursue them?",
"How can I effectively communicate progress and updates to investors?",
"How can I optimize my pricing and revenue models for profitability?",
"How can I develop and strengthen my leadership skills?",
"How can I maintain a healthy work-life balance and avoid burnout?",
"How can I maintain a strong company culture and values as we scale?",
"Is my idea truly unique and solving a real problem?"
]
def search(query):
shorts = weaviate_explorer.explore(query)
videos = []
for i in range(3):
download_url = f"https://drive.google.com/uc?id={shorts[0]['link'].split('/')[-2]}"
video_path = gdown.download(download_url, output=f"./video_{i}.mp4")
videos.append(video_path)
return [gr.Video(video_path) for video_path in videos], "\n\n".join([f"- [{r['title']}]({r['link']})" for r in shorts])
title = "Slideo: Your AI-based short video search engine based on @YCombinator"
description = "Enter a search query, question or topic to receive the top 5 most relevant short video answers. The most relevant clips will be displayed separately, and they will also be included in the list of top 5 video titles with links to Google Drive."
input_text = gr.Textbox(placeholder="Your query, question, topic, ...", label="Query")
videos_row = gr.Row()
output_text = gr.Markdown(label="Top-5 relevant clips")
iface = gr.Interface(
fn=search,
inputs=input_text,
outputs=[videos_row, output_text],
title=title,
description=description,
examples=[[e] for e in examples],
cache_examples="lazy",
theme="dark-gradients",
layout="vertical",
)
iface.dependencies[0]["show_progress"] = "hidden"
iface.launch(auth=(os.getenv("username"), os.getenv("password")))