Spaces:
Sleeping
Sleeping
Commit
·
518f93e
1
Parent(s):
2940841
add spaces compatibility
Browse files
app.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from mosaic import Mosaic # adjust import as needed
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# Maximum number of model textboxes
|
| 5 |
MAX_MODELS = 10
|
|
@@ -39,6 +41,7 @@ def remove_textboxes(n_visible):
|
|
| 39 |
updates.append(gr.update(visible=False, value=""))
|
| 40 |
return (n_visible, *updates)
|
| 41 |
|
|
|
|
| 42 |
def run_scoring(input_text, model1, model2, model3, model4, model5, model6, model7, model8, model9, model10, threshold_choice, custom_threshold):
|
| 43 |
"""
|
| 44 |
Collect all non-empty model paths, instantiate Mosaic, compute the score,
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from mosaic import Mosaic # adjust import as needed
|
| 3 |
+
import spaces
|
| 4 |
+
|
| 5 |
|
| 6 |
# Maximum number of model textboxes
|
| 7 |
MAX_MODELS = 10
|
|
|
|
| 41 |
updates.append(gr.update(visible=False, value=""))
|
| 42 |
return (n_visible, *updates)
|
| 43 |
|
| 44 |
+
@spaces.GPU()
|
| 45 |
def run_scoring(input_text, model1, model2, model3, model4, model5, model6, model7, model8, model9, model10, threshold_choice, custom_threshold):
|
| 46 |
"""
|
| 47 |
Collect all non-empty model paths, instantiate Mosaic, compute the score,
|