eaglelandsonce commited on
Commit
445cf92
1 Parent(s): 9555332

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -27
app.py CHANGED
@@ -39,9 +39,9 @@ gemini_llm = GoogleGenerativeAI(model="gemini-pro", google_api_key=GOOGLE_AI_STU
39
  def crewai_process_gemini(research_topic):
40
  # Define your agents with roles and goals
41
  GeminiAgent = Agent(
42
- role='Summary Evaluator',
43
- goal='To learn how to manage her anxiety in social situations through group therapy.',
44
- backstory="""Skilled in running query evaluation""",
45
  verbose=True,
46
  allow_delegation=False,
47
  llm = gemini_llm,
@@ -55,8 +55,7 @@ def crewai_process_gemini(research_topic):
55
 
56
  # Create tasks for your agents
57
  task1 = Task(
58
- description=f"""From {research_topic} create your story by writing at least one sentence about each bullet point from each of the five scenes
59
- and make sure you have a transitional statement between scenes . BE VERBOSE.""",
60
  agent=GeminiAgent
61
  )
62
 
@@ -78,9 +77,9 @@ def crewai_process_gemini(research_topic):
78
  def crewai_process_mixtral_crazy(research_topic):
79
  # Define your agents with roles and goals
80
  MixtralCrazyAgent = Agent(
81
- role='Summary Evaluator',
82
- goal='Evaluate the summary using the HHEM-Victara Tuner',
83
- backstory="""Skilled in running query evaluation""",
84
  verbose=True,
85
  allow_delegation=False,
86
  llm = gemini_llm,
@@ -93,8 +92,7 @@ def crewai_process_mixtral_crazy(research_topic):
93
 
94
  # Create tasks for your agents
95
  task1 = Task(
96
- description=f"""From {research_topic} create your story by writing at least one sentence about each bullet point from each of the five scenes
97
- and make sure you have a transitional statement between scenes . BE VERBOSE.""",
98
  agent=MixtralCrazyAgent
99
  )
100
 
@@ -115,9 +113,9 @@ def crewai_process_mixtral_crazy(research_topic):
115
  def crewai_process_mixtral_normal(research_topic):
116
  # Define your agents with roles and goals
117
  MixtralNormalAgent = Agent(
118
- role='Summary Evaluator',
119
- goal='Evaluate the summary using the HHEM-Victara Tuner',
120
- backstory="""Skilled in running query evaluation""",
121
  verbose=True,
122
  allow_delegation=False,
123
  llm = gemini_llm,
@@ -130,8 +128,7 @@ def crewai_process_mixtral_normal(research_topic):
130
 
131
  # Create tasks for your agents
132
  task1 = Task(
133
- description=f"""From {research_topic} create your story by writing at least one sentence about each bullet point from each of the five scenes
134
- and make sure you have a transitional statement between scenes . BE VERBOSE.""",
135
  agent=MixtralNormalAgent
136
  )
137
 
@@ -152,9 +149,9 @@ def crewai_process_mixtral_normal(research_topic):
152
  def crewai_process_zephyr_normal(research_topic):
153
  # Define your agents with roles and goals
154
  ZephrNormalAgent = Agent(
155
- role='Summary Evaluator',
156
- goal='Evaluate the summary using the HHEM-Victara Tuner',
157
- backstory="""Skilled in running query evaluation""",
158
  verbose=True,
159
  allow_delegation=False,
160
  llm = gemini_llm,
@@ -167,8 +164,7 @@ def crewai_process_zephyr_normal(research_topic):
167
 
168
  # Create tasks for your agents
169
  task1 = Task(
170
- description=f"""From {research_topic} create your story by writing at least one sentence about each bullet point from each of the five scenes
171
- and make sure you have a transitional statement between scenes . BE VERBOSE.""",
172
  agent=ZephrNormalAgent
173
  )
174
 
@@ -189,9 +185,9 @@ def crewai_process_zephyr_normal(research_topic):
189
  def crewai_process_phi2(research_topic):
190
  # Define your agents with roles and goals
191
  Phi2Agent = Agent(
192
- role='Emily Mental Patient Graphic Designer Anxiety',
193
- goal='Evaluate the summary using the HHEM-Victara Tuner',
194
- backstory="""Skilled in running query evaluation""",
195
  verbose=True,
196
  allow_delegation=False,
197
  llm = gemini_llm,
@@ -204,8 +200,7 @@ def crewai_process_phi2(research_topic):
204
 
205
  # Create tasks for your agents
206
  task1 = Task(
207
- description=f"""From {research_topic} create your story by writing at least one sentence about each bullet point from each of the five scenes
208
- and make sure you have a transitional statement between scenes . BE VERBOSE.""",
209
  agent=Phi2Agent
210
  )
211
 
@@ -226,6 +221,10 @@ def crewai_process_phi2(research_topic):
226
 
227
 
228
 
 
 
 
 
229
  # Initialize the HHEM model +++++++++++++++++++++++++++++++++++++++++++++++
230
  model = CrossEncoder('vectara/hallucination_evaluation_model')
231
 
@@ -422,9 +421,8 @@ with tab4:
422
  st.header("Model Evaluation")
423
 
424
  # User input for the research topic
425
- #research_topic = st.text_area('Enter your research topic:', '', height=100)
426
 
427
- research_topic = text1
428
 
429
  # Selection box for the function to execute
430
  process_selection = st.selectbox(
 
39
  def crewai_process_gemini(research_topic):
40
  # Define your agents with roles and goals
41
  GeminiAgent = Agent(
42
+ role='Story Writer',
43
+ goal='To create a story from bullet points.',
44
+ backstory="""You are an expert writer that understands how to make the average extraordinary on paper """,
45
  verbose=True,
46
  allow_delegation=False,
47
  llm = gemini_llm,
 
55
 
56
  # Create tasks for your agents
57
  task1 = Task(
58
+ description=f"""Create a one paragraph summary of the {research_topic}""",
 
59
  agent=GeminiAgent
60
  )
61
 
 
77
  def crewai_process_mixtral_crazy(research_topic):
78
  # Define your agents with roles and goals
79
  MixtralCrazyAgent = Agent(
80
+ role='Story Writer',
81
+ goal='To create a story from bullet points.',
82
+ backstory="""You are an expert writer that understands how to make the average extraordinary on paper """,
83
  verbose=True,
84
  allow_delegation=False,
85
  llm = gemini_llm,
 
92
 
93
  # Create tasks for your agents
94
  task1 = Task(
95
+ description=f"""Create a one paragraph summary of the {research_topic}""",
 
96
  agent=MixtralCrazyAgent
97
  )
98
 
 
113
  def crewai_process_mixtral_normal(research_topic):
114
  # Define your agents with roles and goals
115
  MixtralNormalAgent = Agent(
116
+ role='Story Writer',
117
+ goal='To create a story from bullet points.',
118
+ backstory="""You are an expert writer that understands how to make the average extraordinary on paper """,
119
  verbose=True,
120
  allow_delegation=False,
121
  llm = gemini_llm,
 
128
 
129
  # Create tasks for your agents
130
  task1 = Task(
131
+ description=f"""Create a one paragraph summary of the {research_topic}""",
 
132
  agent=MixtralNormalAgent
133
  )
134
 
 
149
  def crewai_process_zephyr_normal(research_topic):
150
  # Define your agents with roles and goals
151
  ZephrNormalAgent = Agent(
152
+ role='Story Writer',
153
+ goal='To create a story from bullet points.',
154
+ backstory="""You are an expert writer that understands how to make the average extraordinary on paper """,
155
  verbose=True,
156
  allow_delegation=False,
157
  llm = gemini_llm,
 
164
 
165
  # Create tasks for your agents
166
  task1 = Task(
167
+ description=f"""Create a one paragraph summary of the {research_topic}""",
 
168
  agent=ZephrNormalAgent
169
  )
170
 
 
185
  def crewai_process_phi2(research_topic):
186
  # Define your agents with roles and goals
187
  Phi2Agent = Agent(
188
+ role='Story Writer',
189
+ goal='To create a story from bullet points.',
190
+ backstory="""You are an expert writer that understands how to make the average extraordinary on paper """,
191
  verbose=True,
192
  allow_delegation=False,
193
  llm = gemini_llm,
 
200
 
201
  # Create tasks for your agents
202
  task1 = Task(
203
+ description=f"""Create a one paragraph summary of the {research_topic}""",
 
204
  agent=Phi2Agent
205
  )
206
 
 
221
 
222
 
223
 
224
+
225
+
226
+
227
+
228
  # Initialize the HHEM model +++++++++++++++++++++++++++++++++++++++++++++++
229
  model = CrossEncoder('vectara/hallucination_evaluation_model')
230
 
 
421
  st.header("Model Evaluation")
422
 
423
  # User input for the research topic
424
+ research_topic = st.text_area('Enter your research topic:', '', height=100)
425
 
 
426
 
427
  # Selection box for the function to execute
428
  process_selection = st.selectbox(