Spaces:
Sleeping
Sleeping
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) | |
video_paths = [] | |
markdown_links = [] | |
# Assuming you can get up to 3 videos | |
for short in shorts[:3]: | |
download_url = f"https://drive.google.com/uc?id={short['link'].split('/')[-2]}" | |
video_path = gdown.download(download_url, output=f"./video_{shorts.index(short)}.mp4") | |
video_paths.append(video_path) | |
markdown_links.append(f"- [{short['title']}]({short['link']})") | |
return video_paths, "\n\n".join(markdown_links) | |
title = "Slideo: Your AI-based short video search engine. Based on YC" | |
description = "Enter a search query to receive relevant short video answers." | |
input_text = gr.Textbox(placeholder="Your query, question, topic, ...", label="Query") | |
videos = [gr.Video(label=f"Clip {i+1}") for i in range(3)] | |
output_text = gr.Markdown(label="Relevant clips") | |
iface = gr.Interface( | |
fn=search, | |
inputs=input_text, | |
outputs=[gr.Row(videos), output_text], | |
title=title, | |
description=description, | |
examples=[[e] for e in examples], | |
cache_examples="lazy", | |
theme="dark" | |
) | |
iface.launch(auth=(os.getenv("username"), os.getenv("password"))) |