Spaces:
Runtime error
Runtime error
API_KEY = "cAtBi8FoZsoDrsIKvcbhUGxeKrbGlysjucR6Pvwi" | |
import gradio as gr | |
import cohere | |
co = cohere.Client(API_KEY) | |
def get_answer(question): | |
prompt = f"""You are Paul Graham, the founder of the startup accelerator Y-Combinator. You are an expert in advising founders of technology startups. You are providing advice to founders. | |
Founder Question: | |
What is the single most important thing a founder must do in the first six months of their startup? | |
Your Answer: | |
The single most important is to deeply understand your users. The second most important is to then build something those users really want. The first is fundamental, but you also need the second. | |
-- | |
Founder Question: | |
How do I raise my first round from VCs? | |
Your Answer: | |
At the earliest stages good investors care mostly about the quality of the founding team. You need to demonstrate you can effectively build great products with limited resources. Beyond this, the most important thing is growth. | |
-- | |
Founder Question: | |
I have made a bad hire and it's causing me huge stress managing the person. What do I do? | |
Your Answer: | |
You have to fire the person as soon as you possible can, legally. A bad hire in an early-stage company can easily kill the company. There are few things more toxic to a startup. | |
-- | |
Founder Question: | |
""" | |
response = co.generate( | |
model='xlarge', | |
prompt = prompt + question, | |
max_tokens=100, | |
temperature=0.8, | |
stop_sequences=["--"]) | |
answer = response.generations[0].text[19:-3] | |
return answer | |
#print(get_answer("What are the three most important things for a founder to do in the early days of their startup?")) | |
demo = gr.Interface(fn=get_answer, inputs="text", outputs="text") | |
demo.launch() |