File size: 2,976 Bytes
03c648f
8e9d0f7
a20be5b
 
 
 
8e9d0f7
6279d79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e19a91f
 
6279d79
 
dd15546
a20be5b
8cdb181
 
 
209e859
8cdb181
9d4bc97
ed26ec4
8cdb181
 
 
209e859
c235c30
8cdb181
 
 
209e859
ed26ec4
9d4bc97
ed26ec4
76bf8dd
8cdb181
 
03c648f
ffdb835
03c648f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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)
    download_url = f"https://drive.google.com/uc?id={shorts[0]['link'].split('/')[-2]}"
    video_path = gdown.download(download_url, output=f"./video.mp4")

    return shorts[0]['title'], video_path #, "\n\n".join([f"- [{r['title']}]({r['link']})" for r in shorts])

# title = "<center>Slideo based on YCombinator</center>"
# description = "Enter a search query, question or topic to receive the top 5 most relevant short video answers. The most relevant clip will be displayed separately, and it 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")

title = gr.Markdown()
video = gr.Video(width=640, height=360, label = "Most relevant clip")

iface = gr.Interface(fn=search, 
                     inputs=input_text, 
                     outputs=[title, video],
                    #  outputs=[video, output_text],
                    #  title=title,
                    #  description=description,
                    #  examples=[[e] for e in examples],
                     cache_examples="lazy",
                     theme="dark-gradients")

iface.dependencies[0]["show_progress"] = "hidden"
iface.launch(auth=(os.getenv("username"), os.getenv("password")))