-
Notifications
You must be signed in to change notification settings - Fork 19
Description
I have cloned the repository and before cloning, I ran the command git lfs install. Then I have created a virtualenv as mentioned in the README.md file and then installed all the requirements. When I deploy the application and start the flask ```
server, I give a text and I get the following error from the server.py file:
[2023-10-01 12:15:01,485] ERROR in app: Exception on /run_forward [POST]
Traceback (most recent call last):
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\transformers\modeling_utils.py", line 488, in load_state_dict
return torch.load(checkpoint_file, map_location=map_location)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\torch\serialization.py", line 815, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\torch\serialization.py", line 1033, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_pickle.UnpicklingError: invalid load key, 'v'.During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\flask\app.py", line 1455, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\flask\app.py", line 869, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\flask\app.py", line 867, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\flask\app.py", line 852, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TextSentimentAnalysis\server\server.py", line 31, in forward
model = DistilBertForSequenceClassification.from_pretrained("../models/amazon-distilbert")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\transformers\modeling_utils.py", line 2888, in from_pretrained
state_dict = load_state_dict(resolved_archive_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\transformers\modeling_utils.py", line 493, in load_state_dict
raise OSError(
OSError: You seem to have cloned a repository without having git-lfs installed. Please install git-lfs and rungit lfs installfollowed bygit lfs pullin the folder you cloned.
127.0.0.1 - - [01/Oct/2023 12:15:01] "POST /run_forward HTTP/1.1" 500 -
And in turn the sentiment.py file also raised the following error:
2023-10-01 12:15:01.492 Uncaught app exception
Traceback (most recent call last):
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rosha\AppData\Local\Programs\Python\Python311\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rosha\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rosha\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 541, in _run_script
exec(code, module.dict)
File "D:\TextSentimentAnalysis\streamlit\sentiment.py", line 102, in
main()
File "D:\TextSentimentAnalysis\streamlit\sentiment.py", line 37, in main
output = forward_sentimentAnalysis(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TextSentimentAnalysis\streamlit\sentiment.py", line 68, in forward_sentimentAnalysis
data = r.json()
^^^^^^^^
File "D:\TextSentimentAnalysis\TextSentimentEnv\Lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Can anyone help me with what's going wrong in here?