Update app.py
Browse files
app.py
CHANGED
|
@@ -169,18 +169,20 @@ with gr.Blocks(theme=gr.themes.Default(), css='styles.css') as demo:
|
|
| 169 |
# Here are some examples of prompts we can analyze their internal representations:
|
| 170 |
# ''')
|
| 171 |
|
| 172 |
-
|
| 173 |
-
# with gr.Tab(info['name']):
|
| 174 |
-
# num_examples = 10
|
| 175 |
-
# dataset = load_dataset(info['hf_repo'], split='train', streaming=True)
|
| 176 |
-
# if 'filter' in info:
|
| 177 |
-
# dataset = dataset.filter(info['filter'])
|
| 178 |
-
# dataset = dataset.shuffle(buffer_size=2000).take(num_examples)
|
| 179 |
-
# dataset = [[row[info['text_col']]] for row in dataset]
|
| 180 |
-
# gr.Examples(dataset, [original_prompt_raw])
|
| 181 |
gr.Markdown('''
|
| 182 |
## The Prompt to Analyze
|
| 183 |
''')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
with gr.Group():
|
| 185 |
original_prompt_raw.render()
|
| 186 |
original_prompt_btn = gr.Button('Compute', variant='primary')
|
|
|
|
| 169 |
# Here are some examples of prompts we can analyze their internal representations:
|
| 170 |
# ''')
|
| 171 |
|
| 172 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
gr.Markdown('''
|
| 174 |
## The Prompt to Analyze
|
| 175 |
''')
|
| 176 |
+
for info in dataset_info:
|
| 177 |
+
with gr.Tab(info['name']):
|
| 178 |
+
num_examples = 10
|
| 179 |
+
dataset = load_dataset(info['hf_repo'], split='train', streaming=True)
|
| 180 |
+
if 'filter' in info:
|
| 181 |
+
dataset = dataset.filter(info['filter'])
|
| 182 |
+
dataset = dataset.shuffle(buffer_size=2000).take(num_examples)
|
| 183 |
+
dataset = [[row[info['text_col']]] for row in dataset]
|
| 184 |
+
gr.Examples(dataset, [original_prompt_raw])
|
| 185 |
+
|
| 186 |
with gr.Group():
|
| 187 |
original_prompt_raw.render()
|
| 188 |
original_prompt_btn = gr.Button('Compute', variant='primary')
|