azure-search-openai-demo
azure-search-openai-demo copied to clipboard
UnboundLocalError: cannot access local variable 'doc_int_parser' where it is not associated with a value
Please provide us with the following information:
This issue is for a: (mark with an x)
- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce
Setup cloud resources and load data:
$ azd auth login $ azd env set OPENAI_HOST openai $ azd env set OPENAI_ORGANIZATION $OPENAI_ORGANIZATION $ azd env set OPENAI_API_KEY $OPENAI_API_KEY $ azd up # To deploy the new resources
$ chmod u+x ./scripts/* $ pip install -r requirements-dev.txt # Install the dependencies $ python ./scripts/prepdocs.py --removeall
Any log messages given by the failure
Traceback (most recent call last):
File "/Users/amarppatel/workspace/saathratri-app-holder/hotelchatbot/./scripts/prepdocs.py", line 425, in
Expected/desired behavior
No error and the data in the backend should be deleted along with the index.
OS and Version?
Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) macOS Darwin
azd version?
run
azd versionand copy paste here. azd version 1.6.1
Versions
Mention any other details that might be useful
Thanks! We'll be in touch soon.
Hm, did you run "azd up" a while ago? If you ran it today, it should set up your Document Intelligence environment variables, in AZURE_DOCUMENTINTELLIGENCE_SERVICE, but it seems like it's missing. You can delete this lines for now:
".docx": FileProcessor(doc_int_parser, sentence_text_splitter),
".pptx": FileProcessor(doc_int_parser, sentence_text_splitter),
".xlsx": FileProcessor(doc_int_parser, sentence_text_splitter),
".png": FileProcessor(doc_int_parser, sentence_text_splitter),
".jpg": FileProcessor(doc_int_parser, sentence_text_splitter),
".jpeg": FileProcessor(doc_int_parser, sentence_text_splitter),
".tiff": FileProcessor(doc_int_parser, sentence_text_splitter),
".bmp": FileProcessor(doc_int_parser, sentence_text_splitter),
".heic": FileProcessor(doc_int_parser, sentence_text_splitter),