app.py
CHANGED
@@ -91,8 +91,8 @@ def get_completion(prompt):
|
|
91 |
#def get_completion(prompt):
|
92 |
|
93 |
def greet(company, solution, target_customer, problem, features):
|
94 |
-
|
95 |
-
|
96 |
input = pitch
|
97 |
|
98 |
sys_msg=f"You are {customer_persona}."
|
@@ -123,6 +123,6 @@ Give a score for the product. Format your response as a JSON object with \
|
|
123 |
response = get_completion(total_prompt)
|
124 |
gen_text = response["predictions"][0]["generated_text"]
|
125 |
return json.dumps(extract_json(gen_text, 3))
|
126 |
-
|
127 |
iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Company"), gr.Textbox(label="Solution"), gr.Textbox(label="Customer"), gr.Textbox(label="Problem"), gr.Textbox(label="Feature")], outputs="json")
|
128 |
iface.launch()
|
|
|
91 |
#def get_completion(prompt):
|
92 |
|
93 |
def greet(company, solution, target_customer, problem, features):
|
94 |
+
customer_persona = target_customer
|
95 |
+
pitch = f"""My company, {company} is developing {solution} to help {target_customer} {problem} with {features}"""
|
96 |
input = pitch
|
97 |
|
98 |
sys_msg=f"You are {customer_persona}."
|
|
|
123 |
response = get_completion(total_prompt)
|
124 |
gen_text = response["predictions"][0]["generated_text"]
|
125 |
return json.dumps(extract_json(gen_text, 3))
|
126 |
+
|
127 |
iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Company"), gr.Textbox(label="Solution"), gr.Textbox(label="Customer"), gr.Textbox(label="Problem"), gr.Textbox(label="Feature")], outputs="json")
|
128 |
iface.launch()
|