Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,15 +19,11 @@ finetuned_model_id = "davidr99/finetuned_paligemma_blackjack"
|
|
19 |
|
20 |
import gradio as gr
|
21 |
|
22 |
-
model =
|
23 |
-
|
24 |
|
25 |
def blackjack_ai(image):
|
26 |
global model, processor
|
27 |
-
|
28 |
-
if model == None:
|
29 |
-
model = PaliGemmaForConditionalGeneration.from_pretrained(model_id)
|
30 |
-
processor = AutoProcessor.from_pretrained(finetuned_model_id)
|
31 |
|
32 |
prompt = "<image><bos>extract json\n"
|
33 |
image_file = Image.fromarray(image.astype('uint8'), 'RGB')
|
|
|
19 |
|
20 |
import gradio as gr
|
21 |
|
22 |
+
model = PaliGemmaForConditionalGeneration.from_pretrained(finetuned_model_id)
|
23 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
24 |
|
25 |
def blackjack_ai(image):
|
26 |
global model, processor
|
|
|
|
|
|
|
|
|
27 |
|
28 |
prompt = "<image><bos>extract json\n"
|
29 |
image_file = Image.fromarray(image.astype('uint8'), 'RGB')
|