Spaces:
Running
Running
debu das
commited on
Commit
·
4c17fa9
1
Parent(s):
4cd4a0d
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,9 +3,14 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
import torch
|
| 5 |
from transformers import DonutProcessor, VisionEncoderDecoderModel
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 11 |
model.to(device)
|
|
|
|
| 3 |
|
| 4 |
import torch
|
| 5 |
from transformers import DonutProcessor, VisionEncoderDecoderModel
|
| 6 |
+
radio="debu-das/donut_receipt_v1.20"
|
| 7 |
|
| 8 |
+
radio = gr.Radio(
|
| 9 |
+
["debu-das/donut_receipt_v1.20", "debu-das/donut_receipt_v1.21", "debu-das/donut_receipt_v1.22","debu-das/donut_receipt_v1.23","debu-das/donut_receipt_v1.24",], label="select the model version "
|
| 10 |
+
)
|
| 11 |
+
|
| 12 |
+
processor = DonutProcessor.from_pretrained(radio)
|
| 13 |
+
model = VisionEncoderDecoderModel.from_pretrained(radio)
|
| 14 |
|
| 15 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 16 |
model.to(device)
|