polpoDevs commited on
Commit
3e5ebf0
·
verified ·
1 Parent(s): 6740b62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -64,11 +64,16 @@ def get_answer(chatbot, input_text):
64
  output += f"\nAnswered in {elapsed_time:.1f} seconds, Nr generated words: {count_words(output)}"
65
 
66
  return output
67
-
 
 
 
 
 
 
68
 
69
- chatbot = generate_with_llama_chat(my_config)
70
  text = st.text_area("Enter text to summarize here.")
71
 
72
  if text:
73
- out = get_answer(chatbot, text)
74
  st.write(out)
 
64
  output += f"\nAnswered in {elapsed_time:.1f} seconds, Nr generated words: {count_words(output)}"
65
 
66
  return output
67
+
68
+ if "model_name" not in st.session_state.keys():
69
+ # Initialize the model with the default option
70
+ st.session_state["model_name"] = "BramVanroy/Llama-2-13b-chat-dutch"
71
+ my_config.update({'model_name': st.session_state["model_name"]})
72
+ llm_chatbot = generate_with_llama_dutch(my_config)
73
+ st.session_state["model"] = llm_chatbot
74
 
 
75
  text = st.text_area("Enter text to summarize here.")
76
 
77
  if text:
78
+ out = get_answer(llm_chatbot, text)
79
  st.write(out)