Spaces:
Sleeping
Sleeping
Commit
·
187f902
1
Parent(s):
a02d815
Updated with OCR model and Gradio integration
Browse files
app.py
CHANGED
@@ -8,7 +8,9 @@ repo_id = "OpenGVLab/InternVL2-1B"
|
|
8 |
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
|
9 |
processor = AutoProcessor.from_pretrained(repo_id, trust_remote_code=True)
|
10 |
model = AutoModel.from_pretrained(
|
11 |
-
repo_id,
|
|
|
|
|
12 |
)
|
13 |
|
14 |
# Move model to the appropriate device
|
@@ -33,4 +35,4 @@ demo = gr.Interface(
|
|
33 |
)
|
34 |
|
35 |
if __name__ == "__main__":
|
36 |
-
demo.launch()
|
|
|
8 |
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
|
9 |
processor = AutoProcessor.from_pretrained(repo_id, trust_remote_code=True)
|
10 |
model = AutoModel.from_pretrained(
|
11 |
+
repo_id,
|
12 |
+
trust_remote_code=True,
|
13 |
+
torch_dtype=torch.float16 # Use half-precision for efficiency
|
14 |
)
|
15 |
|
16 |
# Move model to the appropriate device
|
|
|
35 |
)
|
36 |
|
37 |
if __name__ == "__main__":
|
38 |
+
demo.launch(share=True)
|