sam2ai commited on
Commit
df325aa
1 Parent(s): 63e0299

Synced repo using 'sync_with_huggingface' Github Action

Browse files
Roleplay/__pycache__/promptTemplate.cpython-311.pyc CHANGED
Binary files a/Roleplay/__pycache__/promptTemplate.cpython-311.pyc and b/Roleplay/__pycache__/promptTemplate.cpython-311.pyc differ
 
Roleplay/app.py CHANGED
@@ -44,8 +44,10 @@ def main():
44
  assistant = ', '.join(selected_roles_assistant)
45
  # assistant = st.text_input("Assistant Role (EDIT ME)", value=', '.join(selected_roles_assistant))
46
 
47
- # input text for task
48
- # task = st.text_input("Topic")
 
 
49
 
50
  # input text for openAiKey
51
  openAiKey = st.text_input(label="Input the openai key", type="password")
@@ -93,7 +95,7 @@ def main():
93
  try:
94
  if st.session_state.initial2:
95
 
96
- roleplay, user_convo, assistant_convo = conversation_generator(user, assistant, st.session_state["task"])
97
  # roleplay = {'user': 'Actor', 'assistant': 'Chef', 'task': "Planning and preparing healthy meals that meet the actor's strict dietary requirements.", 'conversations': [{'from': 'user', 'value': 'Create a list of movie genres that will inspire each course of the menu.'}, {'from': 'assistant', 'value': 'To create a list of movie genres that will inspire each course of the menu, we can consider a variety of genres that offer distinct flavors and themes. Here is a suggested list:\n\n1. Sci-Fi: Molecular Gastronomy Appetizer\n2. Romance: Elegant Seafood Entrée\n3. Action: Spicy Asian Fusion Main Course\n4. Comedy: Playful Dessert\n5. Western: Smoked BBQ Main Course'}, {'from': 'user', 'value': 'Choose a specific sci-fi movie that will inspire the molecular gastronomy appetizer.'}, {'from': 'assistant', 'value': 'To choose a specific sci-fi movie that will inspire the molecular gastronomy appetizer, we can look for a movie that showcases futuristic technology, innovative concepts, and unique visuals. One movie that fits this description is "Blade Runner." The dystopian setting and advanced technology in the movie can serve as inspiration for creating a visually stunning and futuristic molecular gastronomy appetizer.'}], 'specified_task': 'Chef will help Actor create a delectable five-course menu inspired by movie genres. From a sci-fi-inspired molecular gastronomy appetizer to a western-themed smoked BBQ main course, Chef will bring the flavors and ambiance of each genre to life, ensuring a memorable dining experience for Actor and their guests.', 'length': 4}
98
  st.session_state["roleplay"] = roleplay
99
  st.session_state.initial2 = False
 
44
  assistant = ', '.join(selected_roles_assistant)
45
  # assistant = st.text_input("Assistant Role (EDIT ME)", value=', '.join(selected_roles_assistant))
46
 
47
+ # input for chat_limit
48
+ chat_limit = st.number_input(
49
+ "Messages to generate:", min_value=1, max_value=20, value=5
50
+ )
51
 
52
  # input text for openAiKey
53
  openAiKey = st.text_input(label="Input the openai key", type="password")
 
95
  try:
96
  if st.session_state.initial2:
97
 
98
+ roleplay, user_convo, assistant_convo = conversation_generator(user, assistant, st.session_state["task"],chat_limit)
99
  # roleplay = {'user': 'Actor', 'assistant': 'Chef', 'task': "Planning and preparing healthy meals that meet the actor's strict dietary requirements.", 'conversations': [{'from': 'user', 'value': 'Create a list of movie genres that will inspire each course of the menu.'}, {'from': 'assistant', 'value': 'To create a list of movie genres that will inspire each course of the menu, we can consider a variety of genres that offer distinct flavors and themes. Here is a suggested list:\n\n1. Sci-Fi: Molecular Gastronomy Appetizer\n2. Romance: Elegant Seafood Entrée\n3. Action: Spicy Asian Fusion Main Course\n4. Comedy: Playful Dessert\n5. Western: Smoked BBQ Main Course'}, {'from': 'user', 'value': 'Choose a specific sci-fi movie that will inspire the molecular gastronomy appetizer.'}, {'from': 'assistant', 'value': 'To choose a specific sci-fi movie that will inspire the molecular gastronomy appetizer, we can look for a movie that showcases futuristic technology, innovative concepts, and unique visuals. One movie that fits this description is "Blade Runner." The dystopian setting and advanced technology in the movie can serve as inspiration for creating a visually stunning and futuristic molecular gastronomy appetizer.'}], 'specified_task': 'Chef will help Actor create a delectable five-course menu inspired by movie genres. From a sci-fi-inspired molecular gastronomy appetizer to a western-themed smoked BBQ main course, Chef will bring the flavors and ambiance of each genre to life, ensuring a memorable dining experience for Actor and their guests.', 'length': 4}
100
  st.session_state["roleplay"] = roleplay
101
  st.session_state.initial2 = False
Roleplay/promptTemplate.py CHANGED
@@ -36,6 +36,7 @@ def conversation_generator(user,assistant, task, chat_limit=2):
36
  print(task)
37
  print(user)
38
  print(assistant)
 
39
  role_play_session = RolePlaying(assistant, user, task_prompt)
40
  # print(Fore.CYAN + f"Specified task prompt:\n{role_play_session.task_prompt}\n")
41
  # print(f"Specified task prompt:\n{role_play_session.task_prompt}\n")
 
36
  print(task)
37
  print(user)
38
  print(assistant)
39
+ print(chat_limit)
40
  role_play_session = RolePlaying(assistant, user, task_prompt)
41
  # print(Fore.CYAN + f"Specified task prompt:\n{role_play_session.task_prompt}\n")
42
  # print(f"Specified task prompt:\n{role_play_session.task_prompt}\n")