Spaces:
Sleeping
Sleeping
WilliamGazeley
commited on
Commit
·
bd328c0
1
Parent(s):
a494749
Fix prompt template
Browse files
app.py
CHANGED
@@ -33,7 +33,9 @@ executor = ThreadPoolExecutor(max_workers=2)
|
|
33 |
|
34 |
|
35 |
def generate_base_response(input_text):
|
36 |
-
|
|
|
|
|
37 |
|
38 |
|
39 |
def generate_irai_response(input_text):
|
@@ -58,7 +60,7 @@ def generate_response(input_text):
|
|
58 |
st.title("Base Model vs IRAI LLM-ADE")
|
59 |
user_input = st.text_area("Enter a financial question:", "")
|
60 |
|
61 |
-
if st.button("Generate"):
|
62 |
if user_input:
|
63 |
base_response, irai_response = generate_response(user_input)
|
64 |
col1, col2 = st.columns(2)
|
|
|
33 |
|
34 |
|
35 |
def generate_base_response(input_text):
|
36 |
+
formatted_input = prompt_template.format(input_text=input_text)
|
37 |
+
result = base_pipe(formatted_input)[0]["generated_text"]
|
38 |
+
return result.split("<|assistant|>")[1].strip()
|
39 |
|
40 |
|
41 |
def generate_irai_response(input_text):
|
|
|
60 |
st.title("Base Model vs IRAI LLM-ADE")
|
61 |
user_input = st.text_area("Enter a financial question:", "")
|
62 |
|
63 |
+
if st.button("Generate") or user_input:
|
64 |
if user_input:
|
65 |
base_response, irai_response = generate_response(user_input)
|
66 |
col1, col2 = st.columns(2)
|