MSey90
commited on
Update app.py
Browse filesadd context length
app.py
CHANGED
@@ -13,11 +13,11 @@ model = load_model()
|
|
13 |
st.header("Test Environment for tiny_CaLL_r10_O1_f10_c1022")
|
14 |
user_input = st.text_input("Enter your Prompt here:", "")
|
15 |
contexted_ipnut = context_text(user_input)
|
16 |
-
|
17 |
|
18 |
if user_input:
|
19 |
with st.spinner('Generating response...'):
|
20 |
-
response = model(contexted_ipnut,
|
21 |
-
generated_text = response[0]['generated_text']
|
22 |
st.write("Generated Text:")
|
23 |
-
st.write(generated_text)
|
|
|
13 |
st.header("Test Environment for tiny_CaLL_r10_O1_f10_c1022")
|
14 |
user_input = st.text_input("Enter your Prompt here:", "")
|
15 |
contexted_ipnut = context_text(user_input)
|
16 |
+
context_len = len(contexted_ipnut)
|
17 |
|
18 |
if user_input:
|
19 |
with st.spinner('Generating response...'):
|
20 |
+
response = model(contexted_ipnut, max_new_token = 50, num_return_sequences=1)
|
21 |
+
generated_text = response[0]['generated_text'][context_len:]
|
22 |
st.write("Generated Text:")
|
23 |
+
st.write(generated_text)
|