Update app.py
Browse filesUpdated to the token parameter in from_pretrained
app.py
CHANGED
@@ -81,14 +81,14 @@ st.image(image, caption='Your target document')
|
|
81 |
|
82 |
with st.spinner(f'Processing the document ...'):
|
83 |
pre_trained_model = "unstructuredio/chipper-fast-fine-tuning"
|
84 |
-
processor = DonutProcessor.from_pretrained(pre_trained_model,
|
85 |
|
86 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
87 |
|
88 |
if 'model' in st.session_state:
|
89 |
model = st.session_state['model']
|
90 |
else:
|
91 |
-
model = VisionEncoderDecoderModel.from_pretrained(pre_trained_model,
|
92 |
|
93 |
from huggingface_hub import hf_hub_download
|
94 |
|
|
|
81 |
|
82 |
with st.spinner(f'Processing the document ...'):
|
83 |
pre_trained_model = "unstructuredio/chipper-fast-fine-tuning"
|
84 |
+
processor = DonutProcessor.from_pretrained(pre_trained_model, token=os.environ['HF_TOKEN'])
|
85 |
|
86 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
87 |
|
88 |
if 'model' in st.session_state:
|
89 |
model = st.session_state['model']
|
90 |
else:
|
91 |
+
model = VisionEncoderDecoderModel.from_pretrained(pre_trained_model, token=os.environ['HF_TOKEN'])
|
92 |
|
93 |
from huggingface_hub import hf_hub_download
|
94 |
|