I have been trying to deploy my Question Answering model on St Cloud.
As per steps, I pushed the local model contents to github with my folder name as ‘roberta-base’ which has the .bin model and json.config files.
@st.cache(allow_output_mutation=True)
def question_answering():
model_name = "/app/question-answering/roberta-base/"
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
return model
if st.button('Submit'):
context_input = st.session_state.context
question_input = st.session_state.question_default
with st.spinner('Loading Model'):
my_model = question_answering()
tokenizer_path = "/app/question-answering/roberta-base/"
tokenizer = AutoTokenizer.from_pretrained(tokenizer_path)
question_answerer = pipeline("question-answering", model=my_model, tokenizer=tokenizer)
result = question_answerer(question=question_input, context=context_input)
st.write(HTML_WRAPPER.format(result['answer']), unsafe_allow_html=True)
>>> OSError: It looks like the config file at '/app/question-answering/roberta-base/config.json' is not a valid JSON file.
Next, you likely need to fix your config.json file. Specifically, the value of _name_or_path key, whose current (and possibly incorrect) value is https://github.com/Ayush1702/ESG-Question-Answering/blob/main/roberta-base/.
The Python version is likely not an issue. To change Python versions, you will have to delete the app, and select the appropriate Python version from the Advanced settings modal before you re-deploy your app:
We still don’t have an update on the GitLFS issue.