Spaces:
Sleeping
Sleeping
kz209
commited on
Commit
•
29c23fe
1
Parent(s):
b9e79ed
update
Browse files- pages/summarization_example.py +1 -4
- utils/model.py +1 -1
pages/summarization_example.py
CHANGED
@@ -30,9 +30,6 @@ def generate_answer(sources, model_name):
|
|
30 |
|
31 |
summarization: """
|
32 |
content = meta_prompt.format(sources=sources)
|
33 |
-
|
34 |
-
# pipe = pipeline("text-generation", model="microsoft/Phi-3-mini-4k-instruct", trust_remote_code=True, max_length=500)
|
35 |
-
# messages = [{"role": "user", "content": content}]
|
36 |
answer = model.gen(content)
|
37 |
|
38 |
return answer
|
@@ -56,7 +53,7 @@ def create_summarization_interface():
|
|
56 |
model_dropdown = gr.Dropdown(choices=["gpt-3.5-turbo", "gpt-4o", "gpt-4"], label="Choose a model", value="gpt-3.5-turbo")
|
57 |
|
58 |
input_text = gr.Textbox(label="Input Text", lines=10, placeholder="Enter text here...")
|
59 |
-
submit_button = gr.Button("Submit")
|
60 |
output = gr.Markdown()
|
61 |
|
62 |
example_dropdown.change(update_input, inputs=[example_dropdown], outputs=[input_text])
|
|
|
30 |
|
31 |
summarization: """
|
32 |
content = meta_prompt.format(sources=sources)
|
|
|
|
|
|
|
33 |
answer = model.gen(content)
|
34 |
|
35 |
return answer
|
|
|
53 |
model_dropdown = gr.Dropdown(choices=["gpt-3.5-turbo", "gpt-4o", "gpt-4"], label="Choose a model", value="gpt-3.5-turbo")
|
54 |
|
55 |
input_text = gr.Textbox(label="Input Text", lines=10, placeholder="Enter text here...")
|
56 |
+
submit_button = gr.Button("✨ Submit ✨")
|
57 |
output = gr.Markdown()
|
58 |
|
59 |
example_dropdown.change(update_input, inputs=[example_dropdown], outputs=[input_text])
|
utils/model.py
CHANGED
@@ -16,7 +16,7 @@ class Model():
|
|
16 |
device_map="auto",
|
17 |
)
|
18 |
|
19 |
-
def gen(self, content, temp=0.0, max_length=
|
20 |
sequences = self.pipeline(
|
21 |
content,
|
22 |
max_length=max_length,
|
|
|
16 |
device_map="auto",
|
17 |
)
|
18 |
|
19 |
+
def gen(self, content, temp=0.0, max_length=500):
|
20 |
sequences = self.pipeline(
|
21 |
content,
|
22 |
max_length=max_length,
|