Spaces:
Sleeping
Sleeping
kz209
commited on
Commit
•
589c423
1
Parent(s):
576ef40
update
Browse files
pages/summarization_example.py
CHANGED
@@ -22,6 +22,8 @@ Back in Boston, Kidd is going to rely on Lively even more. He'll play close to 3
|
|
22 |
}
|
23 |
|
24 |
def generate_answer(sources, model_name, prompt):
|
|
|
|
|
25 |
model = Model(model_name)
|
26 |
meta_prompt = prompt
|
27 |
content = meta_prompt.format(sources=sources)
|
@@ -49,10 +51,8 @@ def create_summarization_interface():
|
|
49 |
|
50 |
Template_text = gr.Textbox(value="""{sources}
|
51 |
|
52 |
-
summarization: """, label='Input Prompting Template', lines=10, placeholder='Input your
|
53 |
-
|
54 |
-
assert "{sources}" in Template_text, ValueError("No {sources} Found")
|
55 |
-
|
56 |
input_text = gr.Textbox(label="Input Text", lines=10, placeholder="Enter text here...")
|
57 |
submit_button = gr.Button("✨ Submit ✨")
|
58 |
output = gr.Markdown()
|
|
|
22 |
}
|
23 |
|
24 |
def generate_answer(sources, model_name, prompt):
|
25 |
+
assert "{sources}" in prompt, ValueError("No {sources} Found")
|
26 |
+
|
27 |
model = Model(model_name)
|
28 |
meta_prompt = prompt
|
29 |
content = meta_prompt.format(sources=sources)
|
|
|
51 |
|
52 |
Template_text = gr.Textbox(value="""{sources}
|
53 |
|
54 |
+
summarization: """, label='Input Prompting Template', lines=10, placeholder='Input your prompts, must include \{sources\}')
|
55 |
+
|
|
|
|
|
56 |
input_text = gr.Textbox(label="Input Text", lines=10, placeholder="Enter text here...")
|
57 |
submit_button = gr.Button("✨ Submit ✨")
|
58 |
output = gr.Markdown()
|