Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,12 @@ import tensorflow as tf
|
|
4 |
|
5 |
import gradio as gr
|
6 |
|
|
|
|
|
|
|
7 |
model = AutoModelForTokenClassification.from_pretrained("Battu007/1_Image_Classification")
|
8 |
|
|
|
9 |
def predict_image(opened_image):
|
10 |
img_array = tf.keras.utils.img_to_array(opened_image)
|
11 |
img_array = tf.expand_dims(img_array, 0) #Convert image to one empty batch -> Model was trained on batches
|
|
|
4 |
|
5 |
import gradio as gr
|
6 |
|
7 |
+
from transformers import AutoTokenizer, pipeline, AutoModelForTokenClassification
|
8 |
+
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained("Battu007/1_Image_Classification")
|
10 |
model = AutoModelForTokenClassification.from_pretrained("Battu007/1_Image_Classification")
|
11 |
|
12 |
+
|
13 |
def predict_image(opened_image):
|
14 |
img_array = tf.keras.utils.img_to_array(opened_image)
|
15 |
img_array = tf.expand_dims(img_array, 0) #Convert image to one empty batch -> Model was trained on batches
|