gokaygokay commited on
Commit
231da44
1 Parent(s): a3165fa
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -112,11 +112,16 @@ def create_interface():
112
  try:
113
  # Step 1: Generate Prompt
114
  dynamic_seed = random.randint(0, 1000000)
 
 
 
 
 
 
115
  if custom_input and custom_input.strip():
116
  prompt = llm_node.generate_prompt(dynamic_seed, prompt_type, custom_input)
117
  print(f"Using Custom Input Prompt.")
118
  else:
119
- # Inform the system to create a random prompt based on the selected prompt_type
120
  prompt = llm_node.generate_prompt(dynamic_seed, prompt_type, f"Create a random prompt based on the '{prompt_type}' type.")
121
  print(f"No Custom Input Prompt provided. Generated prompt based on prompt_type: {prompt_type}")
122
 
@@ -129,8 +134,8 @@ def create_interface():
129
  long_talk=long_talk,
130
  compress=compress,
131
  compression_level=compression_level,
132
- poster=poster, # Added the missing 'poster' argument
133
- prompt_type=prompt_type_state,
134
  custom_base_prompt=custom_base_prompt,
135
  provider=provider,
136
  api_key=api_key,
 
112
  try:
113
  # Step 1: Generate Prompt
114
  dynamic_seed = random.randint(0, 1000000)
115
+
116
+ # Update prompt_type if it's "Random"
117
+ if prompt_type == "Random":
118
+ prompt_type = random.choice([t for t in prompt_types if t != "Random"])
119
+ print(f"Random prompt type selected: {prompt_type}")
120
+
121
  if custom_input and custom_input.strip():
122
  prompt = llm_node.generate_prompt(dynamic_seed, prompt_type, custom_input)
123
  print(f"Using Custom Input Prompt.")
124
  else:
 
125
  prompt = llm_node.generate_prompt(dynamic_seed, prompt_type, f"Create a random prompt based on the '{prompt_type}' type.")
126
  print(f"No Custom Input Prompt provided. Generated prompt based on prompt_type: {prompt_type}")
127
 
 
134
  long_talk=long_talk,
135
  compress=compress,
136
  compression_level=compression_level,
137
+ poster=poster,
138
+ prompt_type=prompt_type, # Use the updated prompt_type here
139
  custom_base_prompt=custom_base_prompt,
140
  provider=provider,
141
  api_key=api_key,