Spaces:
Configuration error
Configuration error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __main__ import initalize_models, load_projection_module, projection_module
|
2 |
+
|
3 |
+
tokenizer, model, vision_model, processor = initialize_models()
|
4 |
+
projection_module = load_projection_module()
|
5 |
+
|
6 |
+
img = st.file_uploader("image: ")
|
7 |
+
text = st.text_area("text: ")
|
8 |
+
|
9 |
+
ans = answer_question(
|
10 |
+
img,
|
11 |
+
tokenizer,
|
12 |
+
model,
|
13 |
+
vision_model,
|
14 |
+
processor,
|
15 |
+
projection_module,
|
16 |
+
)
|
17 |
+
|
18 |
+
st.json(ans)
|
19 |
+
|