Faustrix commited on
Commit
a8f34eb
1 Parent(s): 4cf07f6
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -1,8 +1,13 @@
1
  import gradio as gr
2
- from transformers import pipeline
 
 
 
 
 
 
 
3
 
4
- # Initialize the pipeline
5
- pipe = pipeline("visual-question-answering", model="openbmb/MiniCPM-Llama3-V-2_5", trust_remote_code=True)
6
 
7
  # Define the Gradio components
8
  image = gr.Image(type="pil", label="Image")
 
1
  import gradio as gr
2
+ from transformers import AutoModel, AutoTokenizer
3
+
4
+ # Load the model
5
+ model = AutoModel.from_pretrained("openbmb/MiniCPM-Llama3-V-2_5", trust_remote_code=True)
6
+
7
+ # Load the tokenizer
8
+ tokenizer = AutoTokenizer.from_pretrained("openbmb/MiniCPM-Llama3-V-2_5", trust_remote_code=True)
9
+
10
 
 
 
11
 
12
  # Define the Gradio components
13
  image = gr.Image(type="pil", label="Image")