13ze commited on
Commit
67b6246
·
verified ·
1 Parent(s): a499e6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -1,3 +1,20 @@
1
  import gradio as gr
 
 
2
 
3
- gr.load("models/fal/AuraSR-v2").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from PIL import Image
3
+ import numpy as np
4
 
5
+ def process_output(prediction):
6
+ # Assuming the tuple contains numpy arrays representing images
7
+ if isinstance(prediction, tuple):
8
+ # Convert the first element of the tuple to an image
9
+ image_array = prediction[0]
10
+ image = Image.fromarray(image_array.astype('uint8'))
11
+ return image
12
+ return prediction
13
+
14
+ def predict(input_data):
15
+ # Load your model and get the prediction
16
+ prediction = some_model.predict(input_data)
17
+ return process_output(prediction)
18
+
19
+ interface = gr.Interface(fn=predict, inputs="text", outputs="image")
20
+ interface.launch()