Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from crewai_enterprise_content_marketing_ideas.crew import CrewaiEnterpriseContentMarketingCrew
|
3 |
+
|
4 |
+
def generate_content(topic, company):
|
5 |
+
inputs = {"topic": topic, "company": company}
|
6 |
+
crew = CrewaiEnterpriseContentMarketingCrew()
|
7 |
+
result = crew.crew().kickoff(inputs=inputs)
|
8 |
+
return result.raw # Return results to display
|
9 |
+
|
10 |
+
# Create the Gradio interface
|
11 |
+
iface = gr.Interface(
|
12 |
+
fn=generate_content, # Function to call on input
|
13 |
+
inputs=[
|
14 |
+
gr.Textbox(label="Enter Topic", value="AI for Science"),
|
15 |
+
gr.Textbox(label="Enter Company", value="Mila Quebec AI Institute")
|
16 |
+
],
|
17 |
+
outputs="text", # Specify output type
|
18 |
+
title="Creative Content Generator for Mila" # Title of the app
|
19 |
+
)
|
20 |
+
|
21 |
+
# Launch the app
|
22 |
+
iface.launch(share=True)
|