Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
@@ -1,8 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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")
|