Update app.py
Browse files
app.py
CHANGED
|
@@ -197,18 +197,17 @@ with gr.Blocks(theme=gr.themes.Default(), css=css) as demo:
|
|
| 197 |
with gr.Group('Interpretation'):
|
| 198 |
interpretation_prompt = gr.Text(suggested_interpretation_prompts[0], label='Interpretation Prompt')
|
| 199 |
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
gr.Examples(dataset, [original_prompt_raw])
|
| 212 |
|
| 213 |
with gr.Group():
|
| 214 |
original_prompt_raw.render()
|
|
|
|
| 197 |
with gr.Group('Interpretation'):
|
| 198 |
interpretation_prompt = gr.Text(suggested_interpretation_prompts[0], label='Interpretation Prompt')
|
| 199 |
|
| 200 |
+
gr.Markdown('''
|
| 201 |
+
Here are some examples of prompts we can analyze their internal representations
|
| 202 |
+
''')
|
| 203 |
+
|
| 204 |
+
for info in dataset_info:
|
| 205 |
+
with gr.Tab(info['name']):
|
| 206 |
+
num_examples = 10
|
| 207 |
+
dataset = load_dataset(info['hf_repo'], split='train', streaming=True)
|
| 208 |
+
dataset = dataset.shuffle(buffer_size=2000).take(num_examples)
|
| 209 |
+
dataset = [[row[info['text_col']]] for row in dataset]
|
| 210 |
+
gr.Examples(dataset, [original_prompt_raw])
|
|
|
|
| 211 |
|
| 212 |
with gr.Group():
|
| 213 |
original_prompt_raw.render()
|