Spaces:
Runtime error
Runtime error
kz209
commited on
Commit
·
34ffea3
1
Parent(s):
431a171
update
Browse files- pages/arena.py +5 -7
pages/arena.py
CHANGED
|
@@ -11,20 +11,18 @@ from utils.multiple_stream import stream_data
|
|
| 11 |
from pages.summarization_playground import get_model_batch_generation
|
| 12 |
|
| 13 |
def create_arena():
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
with gr.Blocks() as demo:
|
| 15 |
with gr.Group():
|
| 16 |
-
gr.Markdown("## This is a playground to test prompts for clinical dialogue summarizations")
|
| 17 |
-
|
| 18 |
-
with open("prompt/prompt.json", "r") as file:
|
| 19 |
-
json_data = file.read()
|
| 20 |
-
prompts = json.loads(json_data)
|
| 21 |
-
|
| 22 |
datapoint = random.choice(dataset)
|
| 23 |
datapoint = datapoint['section_text'] + '\n\nDialogue:\n' + datapoint['dialogue']
|
| 24 |
submit_button = gr.Button("✨ Submit ✨")
|
| 25 |
|
| 26 |
with gr.Row():
|
| 27 |
-
columns = [gr.Textbox(label=f"Column {i+1}", lines=10) for i in range(
|
| 28 |
|
| 29 |
content_list = [prompt + '\n{' + datapoint + '}\n\nsummary:' for prompt in prompts]
|
| 30 |
model = get_model_batch_generation("Qwen/Qwen2-1.5B-Instruct")
|
|
|
|
| 11 |
from pages.summarization_playground import get_model_batch_generation
|
| 12 |
|
| 13 |
def create_arena():
|
| 14 |
+
with open("prompt/prompt.json", "r") as file:
|
| 15 |
+
json_data = file.read()
|
| 16 |
+
prompts = json.loads(json_data)
|
| 17 |
+
|
| 18 |
with gr.Blocks() as demo:
|
| 19 |
with gr.Group():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
datapoint = random.choice(dataset)
|
| 21 |
datapoint = datapoint['section_text'] + '\n\nDialogue:\n' + datapoint['dialogue']
|
| 22 |
submit_button = gr.Button("✨ Submit ✨")
|
| 23 |
|
| 24 |
with gr.Row():
|
| 25 |
+
columns = [gr.Textbox(label=f"Column {i+1}", lines=10) for i in range(len(prompts))]
|
| 26 |
|
| 27 |
content_list = [prompt + '\n{' + datapoint + '}\n\nsummary:' for prompt in prompts]
|
| 28 |
model = get_model_batch_generation("Qwen/Qwen2-1.5B-Instruct")
|