Update maker.py
Browse files
maker.py
CHANGED
|
@@ -69,7 +69,7 @@ def predict_beta(message, chatbot=[], system_prompt=system_prompt, max_new_token
|
|
| 69 |
advanced,
|
| 70 |
fn_index=0
|
| 71 |
)
|
| 72 |
-
|
| 73 |
if result is not None and len(result) > 0:
|
| 74 |
bot_message = result[0]
|
| 75 |
print(bot_message)
|
|
@@ -120,6 +120,9 @@ def extract_title_prompt_example(text):
|
|
| 120 |
def make_open_gpt(message, history, current_title, current_system_prompt, current_example_input, system_prompt=system_prompt):
|
| 121 |
response = predict_beta(message, history, system_prompt)
|
| 122 |
_, title, system_prompt, example_input = extract_title_prompt_example(response)
|
|
|
|
|
|
|
|
|
|
| 123 |
return "", history + [(message, response)], title, system_prompt, example_input, [(None, welcome_preview_message.format(title, example_input))], example_input, gr.Column(visible=True), gr.Group(visible=True)
|
| 124 |
|
| 125 |
def set_title_example(title, example):
|
|
|
|
| 69 |
advanced,
|
| 70 |
fn_index=0
|
| 71 |
)
|
| 72 |
+
print("Raw API Response:", result)
|
| 73 |
if result is not None and len(result) > 0:
|
| 74 |
bot_message = result[0]
|
| 75 |
print(bot_message)
|
|
|
|
| 120 |
def make_open_gpt(message, history, current_title, current_system_prompt, current_example_input, system_prompt=system_prompt):
|
| 121 |
response = predict_beta(message, history, system_prompt)
|
| 122 |
_, title, system_prompt, example_input = extract_title_prompt_example(response)
|
| 123 |
+
print("Extracted Title:", title)
|
| 124 |
+
print("Extracted System Prompt:", system_prompt)
|
| 125 |
+
print("Extracted Example Input:", example_input)
|
| 126 |
return "", history + [(message, response)], title, system_prompt, example_input, [(None, welcome_preview_message.format(title, example_input))], example_input, gr.Column(visible=True), gr.Group(visible=True)
|
| 127 |
|
| 128 |
def set_title_example(title, example):
|