wjbmattingly commited on
Commit
483be0d
1 Parent(s): e357537

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -46,13 +46,15 @@ with patch("transformers.dynamic_module_utils.get_imports", fixed_get_imports):
46
  except Exception as e:
47
  print(f"Failed to load model: {str(e)}")
48
 
49
- # Load the processor
50
- processor = AutoProcessor.from_pretrained(
51
- model_dir,
52
- trust_remote_code=True,
53
- revision='refs/pr/6'
54
- )
55
- print("Processor loaded successfully!")
 
 
56
  TITLE = "# [Florence-2-DocVQA Demo](https://huggingface.co/HuggingFaceM4/Florence-2-DocVQA)"
57
  DESCRIPTION = "The demo for Florence-2 fine-tuned on DocVQA dataset. You can find the notebook [here](https://colab.research.google.com/drive/1hKDrJ5AH_o7I95PtZ9__VlCTNAo1Gjpf?usp=sharing). Read more about Florence-2 fine-tuning [here](finetune-florence2)."
58
 
 
46
  except Exception as e:
47
  print(f"Failed to load model: {str(e)}")
48
 
49
+ # Load the processor without specifying a revision
50
+ try:
51
+ processor = AutoProcessor.from_pretrained(
52
+ model_dir,
53
+ trust_remote_code=True
54
+ )
55
+ print("Processor loaded successfully!")
56
+ except Exception as e:
57
+ print(f"Failed to load processor: {str(e)}")
58
  TITLE = "# [Florence-2-DocVQA Demo](https://huggingface.co/HuggingFaceM4/Florence-2-DocVQA)"
59
  DESCRIPTION = "The demo for Florence-2 fine-tuned on DocVQA dataset. You can find the notebook [here](https://colab.research.google.com/drive/1hKDrJ5AH_o7I95PtZ9__VlCTNAo1Gjpf?usp=sharing). Read more about Florence-2 fine-tuning [here](finetune-florence2)."
60