shellyTa commited on
Commit
4ecff45
·
1 Parent(s): 8ae5124

fix loading

Browse files
Files changed (1) hide show
  1. app.py +16 -18
app.py CHANGED
@@ -820,24 +820,22 @@ def main():
820
  LOGGER.info(f"FORM {generation_config=}")
821
 
822
  with st.expander("Info"):
823
- try:
824
- data_card = dataset_info(st.session_state.dataset_name).cardData
825
- except (HFValidationError, RepositoryNotFoundError):
826
- pass
827
- else:
828
- st.caption("Dataset")
829
- st.write(data_card)
830
- try:
831
- model_info_respose = model_info(model)
832
- model_card = model_info_respose.cardData
833
- st.session_state["generation_config"]["is_chat"] = (
834
- "conversational" in model_info_respose.tags
835
- )
836
- except (HFValidationError, RepositoryNotFoundError):
837
- pass
838
- else:
839
- st.caption("Model")
840
- st.write(model_card)
841
 
842
  # st.write(f"Model max length: {AutoTokenizer.from_pretrained(model).model_max_length}")
843
 
 
820
  LOGGER.info(f"FORM {generation_config=}")
821
 
822
  with st.expander("Info"):
823
+ if "dataset_name" in st.session_state:
824
+ try:
825
+ data_card = dataset_info(st.session_state.dataset_name).cardData
826
+ st.caption("Dataset")
827
+ st.write(data_card)
828
+ except (HFValidationError, RepositoryNotFoundError):
829
+ pass
830
+
831
+ if "api_call_function" in st.session_state:
832
+ try:
833
+ model_info_response = model_info(model)
834
+ model_card = model_info_response.cardData
835
+ st.caption("Model")
836
+ st.write(model_card)
837
+ except (HFValidationError, RepositoryNotFoundError):
838
+ pass
 
 
839
 
840
  # st.write(f"Model max length: {AutoTokenizer.from_pretrained(model).model_max_length}")
841