Update app.py
Browse files
app.py
CHANGED
@@ -16,6 +16,7 @@ from configs import model_info, dataset_info
|
|
16 |
|
17 |
MAX_PROMPT_TOKENS = 60
|
18 |
MAX_NUM_LAYERS = 50
|
|
|
19 |
|
20 |
@dataclass
|
21 |
class GlobalState:
|
@@ -63,7 +64,7 @@ def reset_model(model_name, *extra_components, with_extra_components=True):
|
|
63 |
if with_extra_components:
|
64 |
for i in range(len(extra_components)):
|
65 |
print('HELLO!!')
|
66 |
-
return extra_components
|
67 |
|
68 |
|
69 |
def get_hidden_states(raw_original_prompt):
|
@@ -157,7 +158,7 @@ with gr.Blocks(theme=gr.themes.Default(), css='styles.css') as demo:
|
|
157 |
|
158 |
with gr.Group():
|
159 |
model_chooser = gr.Radio(label='Choose Your Model', choices=list(model_info.keys()), value=model_name)
|
160 |
-
|
161 |
with gr.Blocks() as demo_blocks:
|
162 |
gr.Markdown('## Choose Your Interpretation Prompt')
|
163 |
with gr.Group('Interpretation'):
|
@@ -221,6 +222,6 @@ with gr.Blocks(theme=gr.themes.Default(), css='styles.css') as demo:
|
|
221 |
|
222 |
extra_components = [interpretation_prompt, original_prompt_raw,
|
223 |
original_prompt_btn, *interpretation_bubbles]
|
224 |
-
model_chooser.change(reset_model, [model_chooser, *extra_components], extra_components)
|
225 |
|
226 |
demo.launch()
|
|
|
16 |
|
17 |
MAX_PROMPT_TOKENS = 60
|
18 |
MAX_NUM_LAYERS = 50
|
19 |
+
welcome_message = '**You are now running {model_name}!!** 🥳🥳🥳'
|
20 |
|
21 |
@dataclass
|
22 |
class GlobalState:
|
|
|
64 |
if with_extra_components:
|
65 |
for i in range(len(extra_components)):
|
66 |
print('HELLO!!')
|
67 |
+
return [welcome_message.format(model_name=model_name), *extra_components]
|
68 |
|
69 |
|
70 |
def get_hidden_states(raw_original_prompt):
|
|
|
158 |
|
159 |
with gr.Group():
|
160 |
model_chooser = gr.Radio(label='Choose Your Model', choices=list(model_info.keys()), value=model_name)
|
161 |
+
welcome_model = gr.Markdown(welcome_message.format(model_name=model_name))
|
162 |
with gr.Blocks() as demo_blocks:
|
163 |
gr.Markdown('## Choose Your Interpretation Prompt')
|
164 |
with gr.Group('Interpretation'):
|
|
|
222 |
|
223 |
extra_components = [interpretation_prompt, original_prompt_raw,
|
224 |
original_prompt_btn, *interpretation_bubbles]
|
225 |
+
model_chooser.change(reset_model, [model_chooser, *extra_components], [welcome_model, *extra_components])
|
226 |
|
227 |
demo.launch()
|